Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: PLEASE HELP!!! REGEXP

by Sweeper (Pilgrim)
on Apr 05, 2002 at 05:50 UTC ( [id://156828]=note: print w/replies, xml ) Need Help??


in reply to Re: PLEASE HELP!!! REGEXP
in thread Get last 7 characters with regexp (was: PLEASE HELP!!! REGEXP)

You can code exactly like that in Perl, thanks to the /x modifier. It allows you to insert comments inside the regexp.
$callerid =~ / # we want to match
             ( # and remember
             . # any character
           {7} # 7 times
             ) # stop remembering
             $ # then the end of line
             /x; # and that's the end of the match
In this particular case, this is overkill, but in some cases, it can be very useful in more cmoplicated situations.

And as all others in this thread have said, I too recommend using substr.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://156828]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-29 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found