Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Regex boundary match

by LanX (Saint)
on Feb 08, 2020 at 14:10 UTC ( [id://11112625]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex boundary match
in thread Regex boundary match

> Can anyone see any possible issues with that?

Well, maybe not in this case, but this ([^\-]|$) will consume a position.

This can become an issue if you start combining with following matches.

That's why I recommended a "lookahead assertion" which is zero width.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^3: Regex boundary match
by ultranerds (Hermit) on Feb 08, 2020 at 14:24 UTC
    Cool thanks - I'll go with your suggestion then :) Much appreciated

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found