Hello Monks
Not sure how I have never come across this before but I can't figure out how to get the rest of a string after it has been matched!? E.g:This code places my matched string in $1. However, I need to keep going to perform a regex on the remainder of the string. I could split the original string on the $1 value but am I missing a simple trick!?my $file = "TEST SHOW S01E01"; if(($file =~ m/(.*?)(\d+)/i) { my $show = $1; print "Show name: $show\n"; } Show name: TEST SHOW S
In reply to Regex Matching Query by packetstormer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |