develooper Front page | perl.perl6.users | Postings from September 2018

Re: tip: that annoying character at the end

Thread Previous | Thread Next
From:
Brad Gilbert
Date:
September 15, 2018 03:44
Subject:
Re: tip: that annoying character at the end
Message ID:
CAD2L-T2hyWUkVtrEJ1kk=vq2tw7hycUdyE=zOL8qc9X1ZdTSUA@mail.gmail.com
On Fri, Sep 14, 2018 at 10:11 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:
>
> On 09/14/2018 07:34 PM, Brad Gilbert wrote:
> >     $x ~~ s/ <:Cc>+ $ //;
>
> What exactly is <:Cc> again?

< and >  inside of a regular expression is for advanced features

If the first character is   :   then it knows to look for Unicode properties

One of those properties is GeneralCategory.

The General Category for the weird characters is Cc

( I think it is Control, common )

So this works

    / <:GeneralCategory<Cc>> /

As a shortcut, you can leave off the "GeneralCategory" portion

    / <:Cc> /

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About