On Wed, 18 Jan 2017 18:16:20 -0800, c...@zoffix.com wrote:
> the :sigspace adverb does not affect spaces inside character class.
> Should it?
> 
No, I don't think so. `<.ws>` can match any number of characters (including 
zero). A char class is defining something a matcher for a single character.

> Note that having JUST space inside also causes a weird error to be
> thrown:
> 
> <Zoffix> m: say " " ~~ m:s/<-[ ]>/
> <camelia> rakudo-moar 1aeea1: OUTPUT«===SORRY!===␤Iteration past end
> of iterator␤»
> 
That one's certainly a bug. Since whitespace in a charclass is not significant, 
then it should complain about an empty charclass, preferably with a hint about 
space.

> <Zoffix> m: say " " ~~ m:s/<-[x ]>/
> <camelia> rakudo-moar 1aeea1: OUTPUT«「 」␤»
This matches because it's the same as m:s/<-[x]>/. You'd need to write <-[x\ ]> 
to make the space significant.

> <Zoffix> m: say " " ~~ m:s/<-[ x]>/
> <camelia> rakudo-moar 1aeea1: OUTPUT«「 」␤»
Ditto.

/jnthn

Reply via email to