Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re-define Word Boundary?

by thospel (Hermit)
on Nov 21, 2003 at 03:55 UTC ( [id://308800]=note: print w/replies, xml ) Need Help??


in reply to Re-define Word Boundary?

You're not actually USING the \b, since you will match the same things without them (the \w+ will start at the earliest possible moment and stop at the last moment, both of which points will be \b boundaries).

Now assuming you want to actually match "a/c" in the case of your example, you are also changing the meaning of \w, and your new \b still isn't used, so you can just as well write:

while ($rec =~ m![\w/]+!g) { $word = $&; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found