Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Match the starting \>

by CountZero (Bishop)
on May 15, 2009 at 06:19 UTC ( [id://764189]=note: print w/replies, xml ) Need Help??


in reply to Match the starting \>

There is no reason to escape < or >. They are not special in a regex.

This is the list of the so-called meta-characters: {}[]()^$.|*+?\

If you want to match one of those you must escape it.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Match the starting \>
by cdarke (Prior) on May 15, 2009 at 08:22 UTC
    They are not special in a regex.

    That is true for Perl, but some regex engines (GNU) use \< and \> as word boundary anchors, where \< is beginning of word and \> is end of word, whereas Perl only has \b. The argument against \b is that it is easily confused with a backspace character, and that it does not differentiate between start and end of word.

    So, using \< and \> could be doubly confusing to anyone coming from other RE regimes. Matching a string starting with a word-ending?

Log In?
Username:
Password:

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

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

    No recent polls found