Skip to content

Commit

Permalink
Need to escape space even in character class
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Aug 9, 2022
1 parent 2b04c35 commit c6b1f50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions regexps.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,9 @@ Spaces and new lines are ignored, as is everything after `#`.
phone <- regex(r"(
\(? # optional opening parens
(\d{3}) # area code
[) -]? # optional closing parens, space, or dash
[)\ -]? # optional closing parens, space, or dash
(\d{3}) # another three numbers
[ -]? # optional space or dash
[\ -]? # optional space or dash
(\d{3}) # three more numbers
)", comments = TRUE)
Expand Down

0 comments on commit c6b1f50

Please sign in to comment.