IOW, there's nothing left for your capture after leading .* matched everything in your string.
Read, instead, about look-aheads or try capturing the first Sanity_001_ and the balance of the string (to a second capture clause), and printing/saving only $2 -- either can help you, but learning about look-aheads (and the general category, of which it's a part, "look arounds") will help you greatly, even in the short term.
In reply to Re: regular expression
by ww
in thread regular expression
by Rahul Gupta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |