Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Documentation request: list of shortcut symbols #81

@MichaelChirico

Description

@MichaelChirico

I am trying to figure out how to replicate \w with rex, and coming up short.

There are scattered references to some shortcut symbols -- e.g. numbers is referenced in the README:

rex/README.md

Line 35 in 6f437eb

maybe(capture(":", capture(numbers))),

And alphas shows up in the CRAN help index under ?re_matches:

rex/R/match.R

Line 23 in 6f437eb

#' re_matches(string, rex(capture(alphas, name = "first_word"), space,

But I don't see anything else to help here. numbers isn't mentioned in the help at all.

It took (IMHO) way too much effort to find this:

rex/R/shortcuts.R

Lines 12 to 34 in 9ec302f

single_shortcuts <- shortcut(
## Character class shortcuts
alnum = character_class("[:alnum:]"),
alpha = character_class("[:alpha:]"),
letter = character_class("[:alpha:]"),
blank = character_class("[:blank:]"),
cntrl = character_class("[:cntrl:]"),
digit = character_class("[:digit:]"),
number = character_class("[:digit:]"),
graph = character_class("[:graph:]"),
lower = character_class("[:lower:]"),
print = character_class("[:print:]"),
punct = character_class("[:punct:]"),
space = character_class("[:space:]"),
upper = character_class("[:upper:]"),
xdigit = character_class("[:xdigit:]"),
newline = regex("\\R"),
single_quote = character_class("'"),
double_quote = character_class("\""),
quote = character_class("'\"")
)

(this might be a dup of #79)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions