Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: What this pattern matches

by gopalr (Priest)
on May 12, 2006 at 05:15 UTC ( #548908=note: print w/ replies, xml ) Need Help??


in reply to What this pattern matches

$b='This_is_Sample_Text'; if ($b=~/^(.+)_[^_]+$/) { print "\n$1"; ## This_is_Sample }

. = Match any character (except newline)

+ = Match 1 or more times

.+_ = Match upto last underscore(_)

[^_]+$ = Notmatch underscore(_) upto end of the string


Comment on Re: What this pattern matches
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2015-07-05 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls