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

Re: reg-exp problem

by RMGir (Prior)
on Sep 09, 2008 at 11:34 UTC ( [id://710049]=note: print w/replies, xml ) Need Help??


in reply to reg-exp problem

As others have pointed out, perlre or perlretut are recommended reading, because this is a very important and basic construct in regular expressions.

In a regex, [] surround a "character class", meaning that it matches any of the characters inside the square brackets.

Since split divides a string based on its delimiter regex, in this case, your input string is being split on any of the { } , * characters.

$ $ perl -e'print "$_\n" foreach split /[,{}*]/,"this{is*a}test,of"' this is a test of

Mike

Replies are listed 'Best First'.
Re^2: reg-exp problem
by perlplayer (Sexton) on Sep 09, 2008 at 11:42 UTC
    thanks to all, i will go through the documentation

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-19 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found