Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Split on whitespace or other criteria

by dimar (Curate)
on Jan 30, 2005 at 21:17 UTC ( [id://426431]=note: print w/replies, xml ) Need Help??


in reply to Split on whitespace or other criteria

Just curious ... why do people seem to use

/(?=\-)/
... in regex, instead of ...
/[\-]/

Is the latter variant inferior? going out of style?

Replies are listed 'Best First'.
Re^2: Split on whitespace or other criteria
by Roy Johnson (Monsignor) on Jan 30, 2005 at 23:12 UTC
    The former is a lookahead; it does not eat a character. The latter consumes the "-". Oh, there's no need to backslash it.

    Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-26 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found