-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re
module not matching [\s\S]
and equivalents
#8525
Comments
re
module not matching [\s\S] and equivalentsre
module not matching [\s\S]
and equivalents
Could you test this on a 9.0.0 build to see if the updates from MicroPython fixed it? Thanks. |
Sure thing. I will test and come back with results. |
No problem - this is good. We'll want to decide whether to backport the fix to 8.2.x or simply leave your workaround in until 8.x.x has been supplanted by 9.x.x. |
I will close this, since it's fixed in 9.0.0. We could backport the fix to 8.2.x but having the workaround in the library is good for anyone running a slightly older version, so no need to backport. |
CircuitPython version
Code/REPL
Behavior
When searching for
\S
aka any non-whitespace character,re
module finds a match.Similarly, when searching for
\s
aka any whitespace character,re
module also finds a match.But, when combining them together, creating a popular any character
re
module is unable to match.This pattern is correct, and in theory should be possible to use in CircuitPython, as all the components (

\s
,\S
, sets[]
, non-greedy*?
) are supported.Similar issue hapens when using \d and \D, \w and \W.
Using
.compile()
withre.DOTALL
which is a literal16
, and with changed patterns ([\s\S]
to.
) seems to make it possible to match such strings, but still, the issue is present, it is just going around it.Description
No response
Additional information
Possibly related, but maybe the cause is completely different: #6860
The text was updated successfully, but these errors were encountered: