in reply to Regex Matching Query
Hi packetstormer,
".. I can't figure out how to get the rest of a string after it has been matched!.."
To start with, I will suggest you give good attention to the wisdom given by ww and davido
You can also re-write your script like so to have what you want I suppose:
Using your "$2", you can capture the rest of the string for usage.use warnings; use strict; my $file = "TEST SHOW S01E01"; if ( $file =~ m/(.*?)(\d.+?)$/ ) { # modified line my $show = $1; print "Show name: ", $show, $/, "others: ", $2, $/; }
Hope this helps.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
|
---|
In Section
Seekers of Perl Wisdom