Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Regex Matching Query

by 2teez (Vicar)
on Mar 26, 2013 at 07:36 UTC ( #1025449=note: print w/replies, xml ) Need Help??

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:

use warnings; use strict; my $file = "TEST SHOW S01E01"; if ( $file =~ m/(.*?)(\d.+?)$/ ) { # modified line my $show = $1; print "Show name: ", $show, $/, "others: ", $2, $/; }
Using your "$2", you can capture the rest of the string for usage.
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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025449]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-06-19 03:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.