Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: requesting small regex

by thundergnat (Deacon)
on May 07, 2012 at 18:11 UTC ( #969304=note: print w/ replies, xml ) Need Help??


in reply to Re: requesting small regex
in thread requesting small regex

If you need to work with Unicrap, er.. Unicode, use Unicode named property assertions.

print for split /\P{Alnum}+/, '&#945;&#946;&#950;#!&#1488;&#1513;<>!&# +1046;&#1048;&#1059;+sdfg.%12'; &#945;&#946;&#950; &#1488;&#1513; &#1046;&#1048;&#1059; sdfg 12

Sigh. Imagine that those were not automatically converted to HTML codepoints.


Comment on Re^2: requesting small regex
Download Code
Re^3: requesting small regex
by BrowserUk (Pope) on May 07, 2012 at 18:35 UTC
    magine that those were not automatically converted to HTML codepoints.

    Posting (small) quantities of Unicrap is the one time (I think) that <pre></pre> tags are justified.

    I'm guessing that \P is 'not the named class'; and that {Alnum} is alpha-numeric. Is theRE no \P{Numeric}?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      I'm guessing that \P is 'not the named class';

      Good guess

      and that {Alnum} is alpha-numeric. Is theRE no \P{Numeric}?

      Yes, but it is spelled \P{Digit}. perldoc perlre has details.

      Note: I am replying more for the OPs benefit then yours. I am fully aware that you know about perldoc perlre, and are likely a far better perl programmer than I.

      Cheers

      BTW the OP DID want to split on non-alphanumerics not just non-numerics. Ok, (s)he did say non-alphanomerics but... ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-12-29 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (193 votes), past polls