Skip to content

Commit

Permalink
re-adding the unicode flag to the documentation about regex
Browse files Browse the repository at this point in the history
The regex lib has more possible flags than the base re module. One of these restores the python 2.x re modules unicode flag, which forces the regex lib to treat the string like Unicode. Without it, it will test the type first and evaluate it accordingly. Parsimonious tests for handling unicode via a flag already, so it is useful to restore this in the documentation.

We may consider adding support for the other flags supported by regex in the future
  • Loading branch information
lonnen committed Mar 30, 2022
1 parent 832c94c commit b6a6f54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Syntax Reference
``things+`` One or more things. This is greedy, always consuming as
many repetitions as it can.

``~r"regex"asilmx`` Regexes have ``~`` in front and are quoted like
``~r"regex"ilmsuxa`` Regexes have ``~`` in front and are quoted like
literals. Any flags_ (``asilmx``) follow the end quotes
as single chars. Regexes are good for representing
character classes (``[a-z0-9]``) and optimizing for
Expand Down

0 comments on commit b6a6f54

Please sign in to comment.