using <sp> space in character classes

1 view
Skip to first unread message

Brad Bowman

unread,
Apr 12, 2007, 4:20:45 AM4/12/07
to perl6language
Hello,

In S05, <sp> is listed under named assertions and isn't explicitly
mentioned in the section on character classes.

Can sp be used in character classes, in particular to include or
exclude space (U+0020)? eg. <space-sp>, <alnum+sp>

Is there another way to do this, maybe <[\ ]> escaping?

Thanks,

Brad

--
There are two things that will blemish a retainer, these are riches and
honor. But if one remains in strained circumstances he will not be
marred. -- Hagakure http://bereft.net/hagakure/

Larry Wall

unread,
Apr 12, 2007, 11:53:16 AM4/12/07
to perl6language
On Thu, Apr 12, 2007 at 06:20:45PM +1000, Brad Bowman wrote:
: Hello,

:
: In S05, <sp> is listed under named assertions and isn't explicitly
: mentioned in the section on character classes.
:
: Can sp be used in character classes, in particular to include or
: exclude space (U+0020)? eg. <space-sp>, <alnum+sp>

Yes, but so far PCR only recognizes things that translate to [[:foo:]] or
\p{foo} within character classes. It still needs to be generalized
to allow any subrules that can be interpreted as character classes.

: Is there another way to do this, maybe <[\ ]> escaping?

I believe <-[\x20]> works currently.

Larry

Reply all
Reply to author
Forward
0 new messages