Skip to main content

Alternative regular expression module, to replace re.

Project description

Introduction

This regex implementation is backwards-compatible with the standard ‘re’ module, but offers additional functionality.

Note

The re module’s behaviour with zero-width matches changed in Python 3.7, and this module will follow that behaviour when compiled for Python 3.7.

Old vs new behaviour

In order to be compatible with the re module, this module has 2 behaviours:

  • Version 0 behaviour (old behaviour, compatible with the re module):

    Please note that the re module’s behaviour may change over time, and I’ll endeavour to match that behaviour in version 0.

    • Indicated by the VERSION0 or V0 flag, or (?V0) in the pattern.

    • Zero-width matches are not handled correctly in the re module before Python 3.7. The behaviour in those earlier versions is:

      • .split won’t split a string at a zero-width match.

      • .sub will advance by one character after a zero-width match.

    • Inline flags apply to the entire pattern, and they can’t be turned off.

    • Only simple sets are supported.

    • Case-insensitive matches in Unicode use simple case-folding by default.

  • Version 1 behaviour (new behaviour, possibly different from the re module):

    • Indicated by the VERSION1 or V1 flag, or (?V1) in the pattern.

    • Zero-width matches are handled correctly.

    • Inline flags apply to the end of the group or pattern, and they can be turned off.

    • Nested sets and set operations are supported.

    • Case-insensitive matches in Unicode use full case-folding by default.

If no version is specified, the regex module will default to regex.DEFAULT_VERSION.

Case-insensitive matches in Unicode

The regex module supports both simple and full case-folding for case-insensitive matches in Unicode. Use of full case-folding can be turned on using the FULLCASE or F flag, or (?f) in the pattern. Please note that this flag affects how the IGNORECASE flag works; the FULLCASE flag itself does not turn on case-insensitive matching.

In the version 0 behaviour, the flag is off by default.

In the version 1 behaviour, the flag is on by default.

Nested sets and set operations

It’s not possible to support both simple sets, as used in the re module, and nested sets at the same time because of a difference in the meaning of an unescaped "[" in a set.

For example, the pattern [[a-z]--[aeiou]] is treated in the version 0 behaviour (simple sets, compatible with the re module) as:

  • Set containing “[” and the letters “a” to “z”

  • Literal “–”

  • Set containing letters “a”, “e”, “i”, “o”, “u”

  • Literal “]”

but in the version 1 behaviour (nested sets, enhanced behaviour) as:

  • Set which is:

    • Set containing the letters “a” to “z”

  • but excluding:

    • Set containing the letters “a”, “e”, “i”, “o”, “u”

Version 0 behaviour: only simple sets are supported.

Version 1 behaviour: nested sets and set operations are supported.

Flags

There are 2 kinds of flag: scoped and global. Scoped flags can apply to only part of a pattern and can be turned on or off; global flags apply to the entire pattern and can only be turned on.

The scoped flags are: FULLCASE, IGNORECASE, MULTILINE, DOTALL, VERBOSE, WORD.

The global flags are: ASCII, BESTMATCH, ENHANCEMATCH, LOCALE, POSIX, REVERSE, UNICODE, VERSION0, VERSION1.

If neither the ASCII, LOCALE nor UNICODE flag is specified, it will default to UNICODE if the regex pattern is a Unicode string and ASCII if it’s a bytestring.

The ENHANCEMATCH flag makes fuzzy matching attempt to improve the fit of the next match that it finds.

The BESTMATCH flag makes fuzzy matching search for the best match instead of the next match.

Notes on named capture groups

All capture groups have a group number, starting from 1.

Groups with the same group name will have the same group number, and groups with a different group name will have a different group number.

The same name can be used by more than one group, with later captures ‘overwriting’ earlier captures. All of the captures of the group will be available from the captures method of the match object.

Group numbers will be reused across different branches of a branch reset, eg. (?|(first)|(second)) has only group 1. If capture groups have different group names then they will, of course, have different group numbers, eg. (?|(?P<foo>first)|(?P<bar>second)) has group 1 (“foo”) and group 2 (“bar”).

In the regex (\s+)(?|(?P<foo>[A-Z]+)|(\w+) (?P<foo>[0-9]+) there are 2 groups:

  • (\s+) is group 1.

  • (?P<foo>[A-Z]+) is group 2, also called “foo”.

  • (\w+) is group 2 because of the branch reset.

  • (?P<foo>[0-9]+) is group 2 because it’s called “foo”.

If you want to prevent (\w+) from being group 2, you need to name it (different name, different group number).

Multithreading

The regex module releases the GIL during matching on instances of the built-in (immutable) string classes, enabling other Python threads to run concurrently. It is also possible to force the regex module to release the GIL during matching by calling the matching methods with the keyword argument concurrent=True. The behaviour is undefined if the string changes during matching, so use it only when it is guaranteed that that won’t happen.

Unicode

This module supports Unicode 13.0.0.

Full Unicode case-folding is supported.

Additional features

The issue numbers relate to the Python bug tracker, except where listed as “Hg issue”.

Added support for lookaround in conditional pattern (Hg issue 163)

The test of a conditional pattern can now be a lookaround.

Examples:

>>> regex.match(r'(?(?=\d)\d+|\w+)', '123abc')
<regex.Match object; span=(0, 3), match='123'>
>>> regex.match(r'(?(?=\d)\d+|\w+)', 'abc123')
<regex.Match object; span=(0, 6), match='abc123'>

This is not quite the same as putting a lookaround in the first branch of a pair of alternatives.

Examples:

>>> print(regex.match(r'(?:(?=\d)\d+\b|\w+)', '123abc'))
<regex.Match object; span=(0, 6), match='123abc'>
>>> print(regex.match(r'(?(?=\d)\d+\b|\w+)', '123abc'))
None

In the first example, the lookaround matched, but the remainder of the first branch failed to match, and so the second branch was attempted, whereas in the second example, the lookaround matched, and the first branch failed to match, but the second branch was not attempted.

Added POSIX matching (leftmost longest) (Hg issue 150)

The POSIX standard for regex is to return the leftmost longest match. This can be turned on using the POSIX flag ((?p)).

Examples:

>>> # Normal matching.
>>> regex.search(r'Mr|Mrs', 'Mrs')
<regex.Match object; span=(0, 2), match='Mr'>
>>> regex.search(r'one(self)?(selfsufficient)?', 'oneselfsufficient')
<regex.Match object; span=(0, 7), match='oneself'>
>>> # POSIX matching.
>>> regex.search(r'(?p)Mr|Mrs', 'Mrs')
<regex.Match object; span=(0, 3), match='Mrs'>
>>> regex.search(r'(?p)one(self)?(selfsufficient)?', 'oneselfsufficient')
<regex.Match object; span=(0, 17), match='oneselfsufficient'>

Note that it will take longer to find matches because when it finds a match at a certain position, it won’t return that immediately, but will keep looking to see if there’s another longer match there.

Added (?(DEFINE)...) (Hg issue 152)

If there’s no group called “DEFINE”, then … will be ignored, but any group definitions within it will be available.

Examples:

>>> regex.search(r'(?(DEFINE)(?P<quant>\d+)(?P<item>\w+))(?&quant) (?&item)', '5 elephants')
<regex.Match object; span=(0, 11), match='5 elephants'>

Added (*PRUNE), (*SKIP) and (*FAIL) (Hg issue 153)

(*PRUNE) discards the backtracking info up to that point. When used in an atomic group or a lookaround, it won’t affect the enclosing pattern.

(*SKIP) is similar to (*PRUNE), except that it also sets where in the text the next attempt to match will start. When used in an atomic group or a lookaround, it won’t affect the enclosing pattern.

(*FAIL) causes immediate backtracking. (*F) is a permitted abbreviation.

Added \K (Hg issue 151)

Keeps the part of the entire match after the position where \K occurred; the part before it is discarded.

It does not affect what capture groups return.

Examples:

>>> m = regex.search(r'(\w\w\K\w\w\w)', 'abcdef')
>>> m[0]
'cde'
>>> m[1]
'abcde'
>>>
>>> m = regex.search(r'(?r)(\w\w\K\w\w\w)', 'abcdef')
>>> m[0]
'bc'
>>> m[1]
'bcdef'

Added capture subscripting for expandf and subf/subfn (Hg issue 133)

You can now use subscripting to get the captures of a repeated capture group.

Examples:

>>> m = regex.match(r"(\w)+", "abc")
>>> m.expandf("{1}")
'c'
>>> m.expandf("{1[0]} {1[1]} {1[2]}")
'a b c'
>>> m.expandf("{1[-1]} {1[-2]} {1[-3]}")
'c b a'
>>>
>>> m = regex.match(r"(?P<letter>\w)+", "abc")
>>> m.expandf("{letter}")
'c'
>>> m.expandf("{letter[0]} {letter[1]} {letter[2]}")
'a b c'
>>> m.expandf("{letter[-1]} {letter[-2]} {letter[-3]}")
'c b a'

Added support for referring to a group by number using (?P=...).

This is in addition to the existing \g<...>.

Fixed the handling of locale-sensitive regexes.

The LOCALE flag is intended for legacy code and has limited support. You’re still recommended to use Unicode instead.

Added partial matches (Hg issue 102)

A partial match is one that matches up to the end of string, but that string has been truncated and you want to know whether a complete match could be possible if the string had not been truncated.

Partial matches are supported by match, search, fullmatch and finditer with the partial keyword argument.

Match objects have a partial attribute, which is True if it’s a partial match.

For example, if you wanted a user to enter a 4-digit number and check it character by character as it was being entered:

>>> pattern = regex.compile(r'\d{4}')

>>> # Initially, nothing has been entered:
>>> print(pattern.fullmatch('', partial=True))
<regex.Match object; span=(0, 0), match='', partial=True>

>>> # An empty string is OK, but it's only a partial match.
>>> # The user enters a letter:
>>> print(pattern.fullmatch('a', partial=True))
None
>>> # It'll never match.

>>> # The user deletes that and enters a digit:
>>> print(pattern.fullmatch('1', partial=True))
<regex.Match object; span=(0, 1), match='1', partial=True>
>>> # It matches this far, but it's only a partial match.

>>> # The user enters 2 more digits:
>>> print(pattern.fullmatch('123', partial=True))
<regex.Match object; span=(0, 3), match='123', partial=True>
>>> # It matches this far, but it's only a partial match.

>>> # The user enters another digit:
>>> print(pattern.fullmatch('1234', partial=True))
<regex.Match object; span=(0, 4), match='1234'>
>>> # It's a complete match.

>>> # If the user enters another digit:
>>> print(pattern.fullmatch('12345', partial=True))
None
>>> # It's no longer a match.

>>> # This is a partial match:
>>> pattern.match('123', partial=True).partial
True

>>> # This is a complete match:
>>> pattern.match('1233', partial=True).partial
False

* operator not working correctly with sub() (Hg issue 106)

Sometimes it’s not clear how zero-width matches should be handled. For example, should .* match 0 characters directly after matching >0 characters?

Examples:

# Python 3.7 and later
>>> regex.sub('.*', 'x', 'test')
'xx'
>>> regex.sub('.*?', '|', 'test')
'|||||||||'

# Python 3.6 and earlier
>>> regex.sub('(?V0).*', 'x', 'test')
'x'
>>> regex.sub('(?V1).*', 'x', 'test')
'xx'
>>> regex.sub('(?V0).*?', '|', 'test')
'|t|e|s|t|'
>>> regex.sub('(?V1).*?', '|', 'test')
'|||||||||'

Added capturesdict (Hg issue 86)

capturesdict is a combination of groupdict and captures:

groupdict returns a dict of the named groups and the last capture of those groups.

captures returns a list of all the captures of a group

capturesdict returns a dict of the named groups and lists of all the captures of those groups.

Examples:

>>> m = regex.match(r"(?:(?P<word>\w+) (?P<digits>\d+)\n)+", "one 1\ntwo 2\nthree 3\n")
>>> m.groupdict()
{'word': 'three', 'digits': '3'}
>>> m.captures("word")
['one', 'two', 'three']
>>> m.captures("digits")
['1', '2', '3']
>>> m.capturesdict()
{'word': ['one', 'two', 'three'], 'digits': ['1', '2', '3']}

Allow duplicate names of groups (Hg issue 87)

Group names can now be duplicated.

Examples:

>>> # With optional groups:
>>>
>>> # Both groups capture, the second capture 'overwriting' the first.
>>> m = regex.match(r"(?P<item>\w+)? or (?P<item>\w+)?", "first or second")
>>> m.group("item")
'second'
>>> m.captures("item")
['first', 'second']
>>> # Only the second group captures.
>>> m = regex.match(r"(?P<item>\w+)? or (?P<item>\w+)?", " or second")
>>> m.group("item")
'second'
>>> m.captures("item")
['second']
>>> # Only the first group captures.
>>> m = regex.match(r"(?P<item>\w+)? or (?P<item>\w+)?", "first or ")
>>> m.group("item")
'first'
>>> m.captures("item")
['first']
>>>
>>> # With mandatory groups:
>>>
>>> # Both groups capture, the second capture 'overwriting' the first.
>>> m = regex.match(r"(?P<item>\w*) or (?P<item>\w*)?", "first or second")
>>> m.group("item")
'second'
>>> m.captures("item")
['first', 'second']
>>> # Again, both groups capture, the second capture 'overwriting' the first.
>>> m = regex.match(r"(?P<item>\w*) or (?P<item>\w*)", " or second")
>>> m.group("item")
'second'
>>> m.captures("item")
['', 'second']
>>> # And yet again, both groups capture, the second capture 'overwriting' the first.
>>> m = regex.match(r"(?P<item>\w*) or (?P<item>\w*)", "first or ")
>>> m.group("item")
''
>>> m.captures("item")
['first', '']

Added fullmatch (issue #16203)

fullmatch behaves like match, except that it must match all of the string.

Examples:

>>> print(regex.fullmatch(r"abc", "abc").span())
(0, 3)
>>> print(regex.fullmatch(r"abc", "abcx"))
None
>>> print(regex.fullmatch(r"abc", "abcx", endpos=3).span())
(0, 3)
>>> print(regex.fullmatch(r"abc", "xabcy", pos=1, endpos=4).span())
(1, 4)
>>>
>>> regex.match(r"a.*?", "abcd").group(0)
'a'
>>> regex.fullmatch(r"a.*?", "abcd").group(0)
'abcd'

Added subf and subfn

subf and subfn are alternatives to sub and subn respectively. When passed a replacement string, they treat it as a format string.

Examples:

>>> regex.subf(r"(\w+) (\w+)", "{0} => {2} {1}", "foo bar")
'foo bar => bar foo'
>>> regex.subf(r"(?P<word1>\w+) (?P<word2>\w+)", "{word2} {word1}", "foo bar")
'bar foo'

Added expandf to match object

expandf is an alternative to expand. When passed a replacement string, it treats it as a format string.

Examples:

>>> m = regex.match(r"(\w+) (\w+)", "foo bar")
>>> m.expandf("{0} => {2} {1}")
'foo bar => bar foo'
>>>
>>> m = regex.match(r"(?P<word1>\w+) (?P<word2>\w+)", "foo bar")
>>> m.expandf("{word2} {word1}")
'bar foo'

Detach searched string

A match object contains a reference to the string that was searched, via its string attribute. The detach_string method will ‘detach’ that string, making it available for garbage collection, which might save valuable memory if that string is very large.

Example:

>>> m = regex.search(r"\w+", "Hello world")
>>> print(m.group())
Hello
>>> print(m.string)
Hello world
>>> m.detach_string()
>>> print(m.group())
Hello
>>> print(m.string)
None

Recursive patterns (Hg issue 27)

Recursive and repeated patterns are supported.

(?R) or (?0) tries to match the entire regex recursively. (?1), (?2), etc, try to match the relevant capture group.

(?&name) tries to match the named capture group.

Examples:

>>> regex.match(r"(Tarzan|Jane) loves (?1)", "Tarzan loves Jane").groups()
('Tarzan',)
>>> regex.match(r"(Tarzan|Jane) loves (?1)", "Jane loves Tarzan").groups()
('Jane',)

>>> m = regex.search(r"(\w)(?:(?R)|(\w?))\1", "kayak")
>>> m.group(0, 1, 2)
('kayak', 'k', None)

The first two examples show how the subpattern within the capture group is reused, but is _not_ itself a capture group. In other words, "(Tarzan|Jane) loves (?1)" is equivalent to "(Tarzan|Jane) loves (?:Tarzan|Jane)".

It’s possible to backtrack into a recursed or repeated group.

You can’t call a group if there is more than one group with that group name or group number ("ambiguous group reference").

The alternative forms (?P>name) and (?P&name) are also supported.

Full Unicode case-folding is supported.

In version 1 behaviour, the regex module uses full case-folding when performing case-insensitive matches in Unicode.

Examples (in Python 3):

>>> regex.match(r"(?iV1)strasse", "stra\N{LATIN SMALL LETTER SHARP S}e").span()
(0, 6)
>>> regex.match(r"(?iV1)stra\N{LATIN SMALL LETTER SHARP S}e", "STRASSE").span()
(0, 7)

In version 0 behaviour, it uses simple case-folding for backward compatibility with the re module.

Approximate “fuzzy” matching (Hg issue 12, Hg issue 41, Hg issue 109)

Regex usually attempts an exact match, but sometimes an approximate, or “fuzzy”, match is needed, for those cases where the text being searched may contain errors in the form of inserted, deleted or substituted characters.

A fuzzy regex specifies which types of errors are permitted, and, optionally, either the minimum and maximum or only the maximum permitted number of each type. (You cannot specify only a minimum.)

The 3 types of error are:

  • Insertion, indicated by “i”

  • Deletion, indicated by “d”

  • Substitution, indicated by “s”

In addition, “e” indicates any type of error.

The fuzziness of a regex item is specified between “{” and “}” after the item.

Examples:

  • foo match “foo” exactly

  • (?:foo){i} match “foo”, permitting insertions

  • (?:foo){d} match “foo”, permitting deletions

  • (?:foo){s} match “foo”, permitting substitutions

  • (?:foo){i,s} match “foo”, permitting insertions and substitutions

  • (?:foo){e} match “foo”, permitting errors

If a certain type of error is specified, then any type not specified will not be permitted.

In the following examples I’ll omit the item and write only the fuzziness:

  • {d<=3} permit at most 3 deletions, but no other types

  • {i<=1,s<=2} permit at most 1 insertion and at most 2 substitutions, but no deletions

  • {1<=e<=3} permit at least 1 and at most 3 errors

  • {i<=2,d<=2,e<=3} permit at most 2 insertions, at most 2 deletions, at most 3 errors in total, but no substitutions

It’s also possible to state the costs of each type of error and the maximum permitted total cost.

Examples:

  • {2i+2d+1s<=4} each insertion costs 2, each deletion costs 2, each substitution costs 1, the total cost must not exceed 4

  • {i<=1,d<=1,s<=1,2i+2d+1s<=4} at most 1 insertion, at most 1 deletion, at most 1 substitution; each insertion costs 2, each deletion costs 2, each substitution costs 1, the total cost must not exceed 4

You can also use “<” instead of “<=” if you want an exclusive minimum or maximum.

You can add a test to perform on a character that’s substituted or inserted.

Examples:

  • {s<=2:[a-z]} at most 2 substitutions, which must be in the character set [a-z].

  • {s<=2,i<=3:\d} at most 2 substitutions, at most 3 insertions, which must be digits.

By default, fuzzy matching searches for the first match that meets the given constraints. The ENHANCEMATCH flag will cause it to attempt to improve the fit (i.e. reduce the number of errors) of the match that it has found.

The BESTMATCH flag will make it search for the best match instead.

Further examples to note:

  • regex.search("(dog){e}", "cat and dog")[1] returns "cat" because that matches "dog" with 3 errors (an unlimited number of errors is permitted).

  • regex.search("(dog){e<=1}", "cat and dog")[1] returns " dog" (with a leading space) because that matches "dog" with 1 error, which is within the limit.

  • regex.search("(?e)(dog){e<=1}", "cat and dog")[1] returns "dog" (without a leading space) because the fuzzy search matches " dog" with 1 error, which is within the limit, and the (?e) then it attempts a better fit.

In the first two examples there are perfect matches later in the string, but in neither case is it the first possible match.

The match object has an attribute fuzzy_counts which gives the total number of substitutions, insertions and deletions.

>>> # A 'raw' fuzzy match:
>>> regex.fullmatch(r"(?:cats|cat){e<=1}", "cat").fuzzy_counts
(0, 0, 1)
>>> # 0 substitutions, 0 insertions, 1 deletion.

>>> # A better match might be possible if the ENHANCEMATCH flag used:
>>> regex.fullmatch(r"(?e)(?:cats|cat){e<=1}", "cat").fuzzy_counts
(0, 0, 0)
>>> # 0 substitutions, 0 insertions, 0 deletions.

The match object also has an attribute fuzzy_changes which gives a tuple of the positions of the substitutions, insertions and deletions.

>>> m = regex.search('(fuu){i<=2,d<=2,e<=5}', 'anaconda foo bar')
>>> m
<regex.Match object; span=(7, 10), match='a f', fuzzy_counts=(0, 2, 2)>
>>> m.fuzzy_changes
([], [7, 8], [10, 11])

What this means is that if the matched part of the string had been:

'anacondfuuoo bar'

it would’ve been an exact match.

However, there were insertions at positions 7 and 8:

'anaconda fuuoo bar'
        ^^

and deletions at positions 10 and 11:

'anaconda f~~oo bar'
           ^^

So the actual string was:

'anaconda foo bar'

Named lists (Hg issue 11)

\L<name>

There are occasions where you may want to include a list (actually, a set) of options in a regex.

One way is to build the pattern like this:

>>> p = regex.compile(r"first|second|third|fourth|fifth")

but if the list is large, parsing the resulting regex can take considerable time, and care must also be taken that the strings are properly escaped and properly ordered, for example, “cats” before “cat”.

The new alternative is to use a named list:

>>> option_set = ["first", "second", "third", "fourth", "fifth"]
>>> p = regex.compile(r"\L<options>", options=option_set)

The order of the items is irrelevant, they are treated as a set. The named lists are available as the .named_lists attribute of the pattern object :

>>> print(p.named_lists)
# Python 3
{'options': frozenset({'fifth', 'first', 'fourth', 'second', 'third'})}
# Python 2
{'options': frozenset(['fifth', 'fourth', 'second', 'third', 'first'])}

If there are any unused keyword arguments, ValueError will be raised unless you tell it otherwise:

>>> option_set = ["first", "second", "third", "fourth", "fifth"]
>>> p = regex.compile(r"\L<options>", options=option_set, other_options=[])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python37\lib\site-packages\regex\regex.py", line 348, in compile
    return _compile(pattern, flags, ignore_unused, kwargs)
  File "C:\Python37\lib\site-packages\regex\regex.py", line 585, in _compile
    raise ValueError('unused keyword argument {!a}'.format(any_one))
ValueError: unused keyword argument 'other_options'
>>> p = regex.compile(r"\L<options>", options=option_set, other_options=[], ignore_unused=True)
>>>

Start and end of word

\m matches at the start of a word.

\M matches at the end of a word.

Compare with \b, which matches at the start or end of a word.

Unicode line separators

Normally the only line separator is \n (\x0A), but if the WORD flag is turned on then the line separators are \x0D\x0A, \x0A, \x0B, \x0C and \x0D, plus \x85, \u2028 and \u2029 when working with Unicode.

This affects the regex dot ".", which, with the DOTALL flag turned off, matches any character except a line separator. It also affects the line anchors ^ and $ (in multiline mode).

Set operators

Version 1 behaviour only

Set operators have been added, and a set [...] can include nested sets.

The operators, in order of increasing precedence, are:

  • || for union (“x||y” means “x or y”)

  • ~~ (double tilde) for symmetric difference (“x~~y” means “x or y, but not both”)

  • && for intersection (“x&&y” means “x and y”)

  • -- (double dash) for difference (“x–y” means “x but not y”)

Implicit union, ie, simple juxtaposition like in [ab], has the highest precedence. Thus, [ab&&cd] is the same as [[a||b]&&[c||d]].

Examples:

  • [ab] # Set containing ‘a’ and ‘b’

  • [a-z] # Set containing ‘a’ .. ‘z’

  • [[a-z]--[qw]] # Set containing ‘a’ .. ‘z’, but not ‘q’ or ‘w’

  • [a-z--qw] # Same as above

  • [\p{L}--QW] # Set containing all letters except ‘Q’ and ‘W’

  • [\p{N}--[0-9]] # Set containing all numbers except ‘0’ .. ‘9’

  • [\p{ASCII}&&\p{Letter}] # Set containing all characters which are ASCII and letter

regex.escape (issue #2650)

regex.escape has an additional keyword parameter special_only. When True, only ‘special’ regex characters, such as ‘?’, are escaped.

Examples:

>>> regex.escape("foo!?", special_only=False)
'foo\\!\\?'
>>> regex.escape("foo!?", special_only=True)
'foo!\\?'

regex.escape (Hg issue 249)

regex.escape has an additional keyword parameter literal_spaces. When True, spaces are not escaped.

Examples:

>>> regex.escape("foo bar!?", literal_spaces=False)
'foo\\ bar!\\?'
>>> regex.escape("foo bar!?", literal_spaces=True)
'foo bar!\\?'

Repeated captures (issue #7132)

A match object has additional methods which return information on all the successful matches of a repeated capture group. These methods are:

  • matchobject.captures([group1, ...])

    • Returns a list of the strings matched in a group or groups. Compare with matchobject.group([group1, ...]).

  • matchobject.starts([group])

    • Returns a list of the start positions. Compare with matchobject.start([group]).

  • matchobject.ends([group])

    • Returns a list of the end positions. Compare with matchobject.end([group]).

  • matchobject.spans([group])

    • Returns a list of the spans. Compare with matchobject.span([group]).

Examples:

>>> m = regex.search(r"(\w{3})+", "123456789")
>>> m.group(1)
'789'
>>> m.captures(1)
['123', '456', '789']
>>> m.start(1)
6
>>> m.starts(1)
[0, 3, 6]
>>> m.end(1)
9
>>> m.ends(1)
[3, 6, 9]
>>> m.span(1)
(6, 9)
>>> m.spans(1)
[(0, 3), (3, 6), (6, 9)]

Atomic grouping (issue #433030)

(?>...)

If the following pattern subsequently fails, then the subpattern as a whole will fail.

Possessive quantifiers.

(?:...)?+ ; (?:...)*+ ; (?:...)++ ; (?:...){min,max}+

The subpattern is matched up to ‘max’ times. If the following pattern subsequently fails, then all of the repeated subpatterns will fail as a whole. For example, (?:...)++ is equivalent to (?>(?:...)+).

Scoped flags (issue #433028)

(?flags-flags:...)

The flags will apply only to the subpattern. Flags can be turned on or off.

Definition of ‘word’ character (issue #1693050)

The definition of a ‘word’ character has been expanded for Unicode. It now conforms to the Unicode specification at http://www.unicode.org/reports/tr29/.

Variable-length lookbehind

A lookbehind can match a variable-length string.

Flags argument for regex.split, regex.sub and regex.subn (issue #3482)

regex.split, regex.sub and regex.subn support a ‘flags’ argument.

Pos and endpos arguments for regex.sub and regex.subn

regex.sub and regex.subn support ‘pos’ and ‘endpos’ arguments.

‘Overlapped’ argument for regex.findall and regex.finditer

regex.findall and regex.finditer support an ‘overlapped’ flag which permits overlapped matches.

Splititer

regex.splititer has been added. It’s a generator equivalent of regex.split.

Subscripting for groups

A match object accepts access to the captured groups via subscripting and slicing:

>>> m = regex.search(r"(?P<before>.*?)(?P<num>\d+)(?P<after>.*)", "pqr123stu")
>>> print(m["before"])
pqr
>>> print(len(m))
4
>>> print(m[:])
('pqr123stu', 'pqr', '123', 'stu')

Named groups

Groups can be named with (?<name>...) as well as the current (?P<name>...).

Group references

Groups can be referenced within a pattern with \g<name>. This also allows there to be more than 99 groups.

Named characters

\N{name}

Named characters are supported. (Note: only those known by Python’s Unicode database are supported.)

Unicode codepoint properties, including scripts and blocks

\p{property=value}; \P{property=value}; \p{value} ; \P{value}

Many Unicode properties are supported, including blocks and scripts. \p{property=value} or \p{property:value} matches a character whose property property has value value. The inverse of \p{property=value} is \P{property=value} or \p{^property=value}.

If the short form \p{value} is used, the properties are checked in the order: General_Category, Script, Block, binary property:

  • Latin, the ‘Latin’ script (Script=Latin).

  • BasicLatin, the ‘BasicLatin’ block (Block=BasicLatin).

  • Alphabetic, the ‘Alphabetic’ binary property (Alphabetic=Yes).

A short form starting with Is indicates a script or binary property:

  • IsLatin, the ‘Latin’ script (Script=Latin).

  • IsAlphabetic, the ‘Alphabetic’ binary property (Alphabetic=Yes).

A short form starting with In indicates a block property:

  • InBasicLatin, the ‘BasicLatin’ block (Block=BasicLatin).

POSIX character classes

[[:alpha:]]; [[:^alpha:]]

POSIX character classes are supported. These are normally treated as an alternative form of \p{...}.

The exceptions are alnum, digit, punct and xdigit, whose definitions are different from those of Unicode.

[[:alnum:]] is equivalent to \p{posix_alnum}.

[[:digit:]] is equivalent to \p{posix_digit}.

[[:punct:]] is equivalent to \p{posix_punct}.

[[:xdigit:]] is equivalent to \p{posix_xdigit}.

Search anchor

\G

A search anchor has been added. It matches at the position where each search started/continued and can be used for contiguous matches or in negative variable-length lookbehinds to limit how far back the lookbehind goes:

>>> regex.findall(r"\w{2}", "abcd ef")
['ab', 'cd', 'ef']
>>> regex.findall(r"\G\w{2}", "abcd ef")
['ab', 'cd']
  • The search starts at position 0 and matches 2 letters ‘ab’.

  • The search continues at position 2 and matches 2 letters ‘cd’.

  • The search continues at position 4 and fails to match any letters.

  • The anchor stops the search start position from being advanced, so there are no more results.

Reverse searching

Searches can now work backwards:

>>> regex.findall(r".", "abc")
['a', 'b', 'c']
>>> regex.findall(r"(?r).", "abc")
['c', 'b', 'a']

Note: the result of a reverse search is not necessarily the reverse of a forward search:

>>> regex.findall(r"..", "abcde")
['ab', 'cd']
>>> regex.findall(r"(?r)..", "abcde")
['de', 'bc']

Matching a single grapheme

\X

The grapheme matcher is supported. It now conforms to the Unicode specification at http://www.unicode.org/reports/tr29/.

Branch reset

(?|...|...)

Capture group numbers will be reused across the alternatives, but groups with different names will have different group numbers.

Examples:

>>> regex.match(r"(?|(first)|(second))", "first").groups()
('first',)
>>> regex.match(r"(?|(first)|(second))", "second").groups()
('second',)

Note that there is only one group.

Default Unicode word boundary

The WORD flag changes the definition of a ‘word boundary’ to that of a default Unicode word boundary. This applies to \b and \B.

Timeout (Python 3)

The matching methods and functions support timeouts. The timeout (in seconds) applies to the entire operation:

>>> from time import sleep
>>>
>>> def fast_replace(m):
...     return 'X'
...
>>> def slow_replace(m):
...     sleep(0.5)
...     return 'X'
...
>>> regex.sub(r'[a-z]', fast_replace, 'abcde', timeout=2)
'XXXXX'
>>> regex.sub(r'[a-z]', slow_replace, 'abcde', timeout=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python37\lib\site-packages\regex\regex.py", line 276, in sub
    endpos, concurrent, timeout)
TimeoutError: regex timed out

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regex-2020.10.15.tar.gz (690.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

regex-2020.10.15-cp39-cp39-win_amd64.whl (268.7 kB view details)

Uploaded CPython 3.9Windows x86-64

regex-2020.10.15-cp39-cp39-win32.whl (252.8 kB view details)

Uploaded CPython 3.9Windows x86

regex-2020.10.15-cp39-cp39-manylinux2010_x86_64.whl (668.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

regex-2020.10.15-cp39-cp39-manylinux2010_i686.whl (650.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ i686

regex-2020.10.15-cp39-cp39-manylinux1_x86_64.whl (668.6 kB view details)

Uploaded CPython 3.9

regex-2020.10.15-cp39-cp39-manylinux1_i686.whl (650.8 kB view details)

Uploaded CPython 3.9

regex-2020.10.15-cp38-cp38-win_amd64.whl (268.8 kB view details)

Uploaded CPython 3.8Windows x86-64

regex-2020.10.15-cp38-cp38-win32.whl (252.8 kB view details)

Uploaded CPython 3.8Windows x86

regex-2020.10.15-cp38-cp38-manylinux2010_x86_64.whl (675.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

regex-2020.10.15-cp38-cp38-manylinux2010_i686.whl (657.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ i686

regex-2020.10.15-cp38-cp38-manylinux1_x86_64.whl (675.3 kB view details)

Uploaded CPython 3.8

regex-2020.10.15-cp38-cp38-manylinux1_i686.whl (657.0 kB view details)

Uploaded CPython 3.8

regex-2020.10.15-cp37-cp37m-win_amd64.whl (272.5 kB view details)

Uploaded CPython 3.7mWindows x86-64

regex-2020.10.15-cp37-cp37m-win32.whl (256.6 kB view details)

Uploaded CPython 3.7mWindows x86

regex-2020.10.15-cp37-cp37m-manylinux2010_x86_64.whl (662.4 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

regex-2020.10.15-cp37-cp37m-manylinux2010_i686.whl (644.3 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ i686

regex-2020.10.15-cp37-cp37m-manylinux1_x86_64.whl (662.3 kB view details)

Uploaded CPython 3.7m

regex-2020.10.15-cp37-cp37m-manylinux1_i686.whl (644.3 kB view details)

Uploaded CPython 3.7m

regex-2020.10.15-cp36-cp36m-win_amd64.whl (272.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

regex-2020.10.15-cp36-cp36m-win32.whl (256.7 kB view details)

Uploaded CPython 3.6mWindows x86

regex-2020.10.15-cp36-cp36m-manylinux2010_x86_64.whl (662.2 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

regex-2020.10.15-cp36-cp36m-manylinux2010_i686.whl (644.5 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ i686

regex-2020.10.15-cp36-cp36m-manylinux1_x86_64.whl (662.2 kB view details)

Uploaded CPython 3.6m

regex-2020.10.15-cp36-cp36m-manylinux1_i686.whl (644.5 kB view details)

Uploaded CPython 3.6m

regex-2020.10.15-cp27-cp27m-win_amd64.whl (259.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

regex-2020.10.15-cp27-cp27m-win32.whl (241.4 kB view details)

Uploaded CPython 2.7mWindows x86

File details

Details for the file regex-2020.10.15.tar.gz.

File metadata

  • Download URL: regex-2020.10.15.tar.gz
  • Upload date:
  • Size: 690.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15.tar.gz
Algorithm Hash digest
SHA256 d25f5cca0f3af6d425c9496953445bf5b288bb5b71afc2b8308ad194b714c159
MD5 ef9f43ab182949c79b2c8f869788f8aa
BLAKE2b-256 c9164ea16f4510afd7ce4b77d8ee7ca97717408b3cf99e0a4b3cdd0a47ef6466

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 268.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a51e51eecdac39a50ede4aeed86dbef4776e3b73347d31d6ad0bc9648ba36049
MD5 e1893025bc9750d7194dadac295eecb0
BLAKE2b-256 181579469dea980a14803b6bfdbca25e80fa696700472b577662fd7098f01b8b

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp39-cp39-win32.whl.

File metadata

  • Download URL: regex-2020.10.15-cp39-cp39-win32.whl
  • Upload date:
  • Size: 252.8 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 698f8a5a2815e1663d9895830a063098ae2f8f2655ae4fdc5dfa2b1f52b90087
MD5 32b3f0bcb171afe0f2695f7721ff1bf4
BLAKE2b-256 cc2160a5684ae75898707fa350d2859d314e1491186d755abf4871635cd9677d

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 668.6 kB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 aeac7c9397480450016bc4a840eefbfa8ca68afc1e90648aa6efbfe699e5d3bb
MD5 138e1f6b99799caee1076110e5ce9f68
BLAKE2b-256 db0a6608d1957fc01623323d1f5e5b88bed940856425845c6b73a66af3bd7198

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp39-cp39-manylinux2010_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp39-cp39-manylinux2010_i686.whl
  • Upload date:
  • Size: 650.8 kB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp39-cp39-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 b5eeaf4b5ef38fab225429478caf71f44d4a0b44d39a1aa4d4422cda23a9821b
MD5 42e857d93dc16ee0d3163e64a509a580
BLAKE2b-256 570440302e8fd71fbb2e0b2fd968cfeb60f052f97ac75454b761129dd6d3ffe3

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 668.6 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 af1f5e997dd1ee71fb6eb4a0fb6921bf7a778f4b62f1f7ef0d7445ecce9155d6
MD5 c5522368f2d940ea8e0ac293e4966f45
BLAKE2b-256 b2ed259959a3d4dbda9fd0e622edbd5a0fd5eb6b75e87b6f918716b9b05407af

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp39-cp39-manylinux1_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp39-cp39-manylinux1_i686.whl
  • Upload date:
  • Size: 650.8 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp39-cp39-manylinux1_i686.whl
Algorithm Hash digest
SHA256 85b733a1ef2b2e7001aff0e204a842f50ad699c061856a214e48cfb16ace7d0c
MD5 d3f98f12bb2037b80ba860f9401b3b22
BLAKE2b-256 f2691941d560f99b7bbb31da3b02573c1510bb141574dbd84d6ebee7ae28eb1d

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 268.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 20cdd7e1736f4f61a5161aa30d05ac108ab8efc3133df5eb70fe1e6a23ea1ca6
MD5 77b08e701e3897638b68e3ba6509966e
BLAKE2b-256 7269517788641c7908b220f03767b75f178047f5c427dd79890a580e01fe979a

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp38-cp38-win32.whl.

File metadata

  • Download URL: regex-2020.10.15-cp38-cp38-win32.whl
  • Upload date:
  • Size: 252.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 137da580d1e6302484be3ef41d72cf5c3ad22a076070051b7449c0e13ab2c482
MD5 5565950b6631e8a8780be8d04ad62b0c
BLAKE2b-256 deb93279f8572f24014ece0f4270c6d6fe62ab08a94ce1a3f5af7115f6f8fd73

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 675.3 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 02686a2f0b1a4be0facdd0d3ad4dc6c23acaa0f38fb5470d892ae88584ba705c
MD5 52c80eecba0d32461d926db3f9eb0637
BLAKE2b-256 02f9e4fdc2337c2ee08f0fbf4d9996fea0369bd4719211493d9651cda859fc81

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp38-cp38-manylinux2010_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp38-cp38-manylinux2010_i686.whl
  • Upload date:
  • Size: 657.0 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp38-cp38-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 608d6c05452c0e6cc49d4d7407b4767963f19c4d2230fa70b7201732eedc84f2
MD5 5d612d440ef3089808d1cbeb54bf7839
BLAKE2b-256 8bd666f2466a14753562a0d65586ab7812343bf2c7c72c8dd69516c602cb6f29

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 675.3 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3dd952f3f8dc01b72c0cf05b3631e05c50ac65ddd2afdf26551638e97502107b
MD5 4b09d85105b45e21b0be30c38f5942d4
BLAKE2b-256 1deb994947d2189325285d9cdbbe89f9747f9fd113932a23b147885bebe7acf5

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp38-cp38-manylinux1_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp38-cp38-manylinux1_i686.whl
  • Upload date:
  • Size: 657.0 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 8958befc139ac4e3f16d44ec386c490ea2121ed8322f4956f83dd9cad8e9b922
MD5 c4deecdd9c004fb6ea4bdd6954d6fbeb
BLAKE2b-256 733317ccef9a94d23ec2fb9503df84671a424098c1b6636128f15998f59d2c65

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 272.5 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ef3a55b16c6450574734db92e0a3aca283290889934a23f7498eaf417e3af9f0
MD5 45e6c2078a9b02b8cbb630af5a0b4990
BLAKE2b-256 ccdd3b5f941e13e9732465468c7806f84b65c5fda128f51a5b4d1456a9e684e5

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp37-cp37m-win32.whl.

File metadata

  • Download URL: regex-2020.10.15-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 256.6 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 6c72adb85adecd4522a488a751e465842cdd2a5606b65464b9168bf029a54272
MD5 8ba46e13b60524179fc6ea9c9829f7d5
BLAKE2b-256 50f1efbf86f2fde2add638807c352687c2fa92dd2143bf11a16fb9e2a88353a4

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 662.4 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 aef23aed9d4017cc74d37f703d57ce254efb4c8a6a01905f40f539220348abf9
MD5 1ba34c841938d51bd7b218f92687361c
BLAKE2b-256 cf50f8d272d027f18ce74abe814488066aba4f512120b075e2ad4e34b4cb190f

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp37-cp37m-manylinux2010_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp37-cp37m-manylinux2010_i686.whl
  • Upload date:
  • Size: 644.3 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp37-cp37m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 828618f3c3439c5e6ef8621e7c885ca561bbaaba90ddbb6a7dfd9e1ec8341103
MD5 1a8de5e9ed548b69e2ef831f8e915b8a
BLAKE2b-256 a88fa5f9783eaf0f43760954a9bb223476aeb3fcbbb93834fc2e9b7541107971

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 662.3 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 26b85672275d8c7a9d4ff93dbc4954f5146efdb2ecec89ad1de49439984dea14
MD5 41eef3426e2cc1d06d363ae953759247
BLAKE2b-256 23fb350c95f9ef6731e4aa275a4f5b7042f24e7c1e494f44cb34aaa51146b03c

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 644.3 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 5d4a3221f37520bb337b64a0632716e61b26c8ae6aaffceeeb7ad69c009c404b
MD5 8ce980819bdee7535ec66921447adeea
BLAKE2b-256 27d2aa301a7fb47201f3a0b1c0f2fc6821cd3f778dd665694c415e443d0039bd

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 272.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2f60ba5c33f00ce9be29a140e6f812e39880df8ba9cb92ad333f0016dbc30306
MD5 627880e00338c8f29b7e2a21aba425a7
BLAKE2b-256 abe05705e946cb32c62efd85dc062da60c76b8c747b5af21a45979307207ea8a

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp36-cp36m-win32.whl.

File metadata

  • Download URL: regex-2020.10.15-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 256.7 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 65b6b018b07e9b3b6a05c2c3bb7710ed66132b4df41926c243887c4f1ff303d5
MD5 685cb00633b5a7d5cc3f0ee96bc1a2de
BLAKE2b-256 904729e6497e5d17f15683385054050d0e7d90138b0cb24d8ee91cca686f67c8

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 662.2 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 578ac6379e65eb8e6a85299b306c966c852712c834dc7eef0ba78d07a828f67b
MD5 853084cde9d1b634be3b62ccba0687d6
BLAKE2b-256 5706ece273078382b27b5b5b839627a3eb2dcbbeb3ece30f4ad135f9a2f7b022

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp36-cp36m-manylinux2010_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp36-cp36m-manylinux2010_i686.whl
  • Upload date:
  • Size: 644.5 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp36-cp36m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 6e9f72e0ee49f7d7be395bfa29e9533f0507a882e1e6bf302c0a204c65b742bf
MD5 6d845bf4a076d69bd3216e21648bc223
BLAKE2b-256 a0a82a99d45a83de2fa35ade831d28a2711f15b3bbf0194d2c8473e29c584a9e

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 662.2 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 25991861c6fef1e5fd0a01283cf5658c5e7f7aa644128e85243bc75304e91530
MD5 7706f9c71fca30d3332b5170b97a7970
BLAKE2b-256 9d982fdf5fc2afc1266f82a5a253929dfe7ebf012b2a590b5d26bbbb005c3869

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: regex-2020.10.15-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 644.5 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for regex-2020.10.15-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6d4cdb6c20e752426b2e569128488c5046fb1b16b1beadaceea9815c36da0847
MD5 58febdb6ebe2f896c16914e1a36211e7
BLAKE2b-256 3d6137bed678c8aa5f036d5c7c52c932f43a8e4b68e51fa1e97933dfe71faf2a

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: regex-2020.10.15-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 259.0 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 d81be22d5d462b96a2aa5c512f741255ba182995efb0114e5a946fe254148df1
MD5 b101b13f54b3b753f444d4e8dd6b435e
BLAKE2b-256 4ca309a9c75ccf4ee6fa6e2b626a4e9ee2cd8208961678952def5a56d8aa95d0

See more details on using hashes here.

File details

Details for the file regex-2020.10.15-cp27-cp27m-win32.whl.

File metadata

  • Download URL: regex-2020.10.15-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 241.4 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.5

File hashes

Hashes for regex-2020.10.15-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 e935a166a5f4c02afe3f7e4ce92ce5a786f75c6caa0c4ce09c922541d74b77e8
MD5 d9ad2a12fd08ede5531d3c85747dcf56
BLAKE2b-256 ffdeaa95c507706cf59e4ffca1d29ebd4dc08f4b6ceee1adead443e7c1be9af0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page