#!/bin/bash
s='23353_test.txt'
grep -oP '(?<=_).*(?=\.)' <<< "$s"
sed -n 's/.*_\(.*\)\..*/\1/p' <<< "$s"