Skip to content

Commit

Permalink
re.sub() now has a flags argument
Browse files Browse the repository at this point in the history
  • Loading branch information
akuchling committed Aug 10, 2023
1 parent 132b3e6 commit 05555df
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Doc/howto/regex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,7 @@ hexadecimal::
'Call 0xffd2 for printing, 0xc000 for user code.'

When using the module-level :func:`re.sub` function, the pattern is passed as
the first argument. The pattern may be provided as an object or as a string; if
you need to specify regular expression flags, you must either use a
pattern object as the first parameter, or use embedded modifiers in the
pattern string, e.g. ``sub("(?i)b+", "x", "bbbb BBBB")`` returns ``'x x'``.
the first argument. The pattern may be provided as an object or as a string.


Common Problems
Expand Down

0 comments on commit 05555df

Please sign in to comment.