Skip to content

Commit

Permalink
doc: note that '\ ' is legal in extended mode
Browse files Browse the repository at this point in the history
I'm actually not sure when it became legal to escape a ' ' when extended
mode is enabled, but the docs didn't mention it, and they should.

Fixes #523
  • Loading branch information
BurntSushi committed May 3, 2020
1 parent ad89e8c commit a140b54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
TBD
===

Bug fixes:

* [BUG #523](https://github.com/rust-lang/regex/pull/523):
Add note to documentation that spaces can be escaped in `x` mode.


1.3.7 (2020-04-17)
==================
This release contains a small bug fix that fixes how `regex` forwards crate
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ assert_eq!(after, "03/14/2012, 01/01/2013 and 07/05/2014");
```
If you wish to match against whitespace in this mode, you can still use `\s`,
`\n`, `\t`, etc. For escaping a single space character, you can use its hex
character code `\x20` or temporarily disable the `x` flag, e.g., `(?-x: )`.
`\n`, `\t`, etc. For escaping a single space character, you can escape it
directly with `\ `, use its hex character code `\x20` or temporarily disable
the `x` flag, e.g., `(?-x: )`.
# Example: match multiple regular expressions simultaneously
Expand Down

0 comments on commit a140b54

Please sign in to comment.