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

Re: Demarcate Regexes with Unicode

by Anonymous Monk
on Sep 16, 2011 at 07:07 UTC ( #926332=note: print w/ replies, xml ) Need Help??


in reply to Demarcate Regexes with Unicode

One lamented aspect of Perl is that regexes get really hard to read. ....

If you learn to regex, they're really easy to read :)

why not use a sigil ...

Because its not on the standard keyboard!

Also, its a delimiter not a sigil

Which is why I prefer to use @ for quoting like s@@@ </sarcasm>

But seriously, this is exactly why i prefer \ or

$ perl -MO=Deparse -e " s\\\g " s///g; -e syntax OK $ perl -MO=Deparse -e " sg " s///g; -e syntax OK
or even </sarcasm>

But seriously, between balanced delimiters like

perl -MO=Deparse -e " s {}//g " perl -MO=Deparse -e " s {}\\g " perl -MO=Deparse -e " s {}vvg " perl -MO=Deparse -e " s {}()g " perl -MO=Deparse -e " s {}[]g " perl -MO=Deparse -e " s {}<>g " perl -MO=Deparse -e " s<><>g "

I stick to keyboard characters

s///x
s===x
s,,,x
s!!!x
s~~~x
s>>>x
s}}}x
and the special case s'''x

The x means magic


Comment on Re: Demarcate Regexes with Unicode
Select or Download Code
Re^2: Demarcate Regexes with Unicode
by toro (Beadle) on Sep 16, 2011 at 08:57 UTC
    its a delimiter not a sigil

    Well, it's a section sign, but lawyers sometimes call it Sigil. (I know that namespace is already occupied in this circle.)

    Because its not on the standard keyboard!

    If you're on a Mac it's quite easy to make, and if you're on Ubuntu it's pretty easy to make. On Windows too, I still remember

    Alt + Num0141
    from typing Spanish on a US keyboard.

    Anyway, I admit this approach is not for everybody. I like your suggestions (but I don't have a key for ).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-08-27 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (238 votes), past polls