Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://548908]
[choroba]: That still doesn't make it offensive
[LanX]: of course not
[LanX]: it's pretty ironic if you know the character
choroba likes the movie
[choroba]: Lady_Aleena Do you really need to say "WorldBuilder" after having said "WorldBuilding"?
[LanX]: have to watch it again :)
[Lady_Aleena]: choroba, the tables in that group of modules is from the World Builder's Guidebook, so I thought it best to add the name of the book to the name of the module.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-05-24 22:22 GMT
Find Nodes?
    Voting Booth?