Skip to content

Commit a140b54

Browse files
committed
doc: note that '\ ' is legal in extended mode
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
1 parent ad89e8c commit a140b54

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
TBD
2+
===
3+
4+
Bug fixes:
5+
6+
* [BUG #523](https://github.com/rust-lang/regex/pull/523):
7+
Add note to documentation that spaces can be escaped in `x` mode.
8+
9+
110
1.3.7 (2020-04-17)
211
==================
312
This release contains a small bug fix that fixes how `regex` forwards crate

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ assert_eq!(after, "03/14/2012, 01/01/2013 and 07/05/2014");
152152
```
153153
154154
If you wish to match against whitespace in this mode, you can still use `\s`,
155-
`\n`, `\t`, etc. For escaping a single space character, you can use its hex
156-
character code `\x20` or temporarily disable the `x` flag, e.g., `(?-x: )`.
155+
`\n`, `\t`, etc. For escaping a single space character, you can escape it
156+
directly with `\ `, use its hex character code `\x20` or temporarily disable
157+
the `x` flag, e.g., `(?-x: )`.
157158
158159
# Example: match multiple regular expressions simultaneously
159160

0 commit comments

Comments
 (0)