-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
languageChanges to the Raku Programming LanguageChanges to the Raku Programming Language
Description
NQP provides some very powerful primitives for searching strings for characters (not) matching certain Unicode character classes (see https://github.com/perl6/nqp/blob/master/docs/ops.markdown#findcclass and the CCLASS_xxx constants at https://github.com/perl6/nqp/blob/master/docs/ops.markdown#const .
I propose to expose this functionality by adding a two sets of enums corresponding to the CCLASS_xxx constants, and candidates of index and rindex that take those enums as the needle parameter. This would allow you to search for any non-alphabetic character in a string like this:
say "foo5bar".index(NotAlphabeticChar); # 3
say "foo5bar".index(NotAlphanumericChar); # Nil
A proof-of-concept implementation can be found in this PR: rakudo/rakudo#3409
Metadata
Metadata
Assignees
Labels
languageChanges to the Raku Programming LanguageChanges to the Raku Programming Language