http://www.perlmonks.org?node_id=969304


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.

Replies are listed 'Best First'.
Re^3: requesting small regex
by BrowserUk (Patriarch) 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... ;-)