Skip to content

Conversation

@Gattag
Copy link

@Gattag Gattag commented Apr 10, 2021

MicroPython does not support named classes within [...] (i.e. no [\\w] or [\\s] )

Fixes #38

@2e0byo
Copy link

2e0byo commented Sep 12, 2021

Was just going to PR for the same problem...

However I don't understand [\w.]. Since . matches anything, what's is \w doing? Doubtless something as I've no great experience with re.

@Gattag
Copy link
Author

Gattag commented Sep 13, 2021

However I don't understand [\w.]. Since . matches anything, what's is \w doing? Doubtless something as I've no great experience with re.

When . is inside a character class [...], it not longer matches anything and only matches the literal . character

@tf131
Copy link

tf131 commented Sep 22, 2021

works fine, thank you

@2e0byo
Copy link

2e0byo commented Sep 22, 2021

However I don't understand [\w.]. Since . matches anything, what's is \w doing? Doubtless something as I've no great experience with re.

When . is inside a character class [...], it not longer matches anything and only matches the literal . character

Duh! Thank you. I was being daft.

raise Exception
argNames.append(argName)
regex += '/([\\w.]*)'
regex += '/([A-Za-z0-9_.]*)'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion here. Can we add support for whitespace as well? In order to support links like
http://example.com/some page that would be translated from web browsers with a %20
I have tested in CPython to add \s and works but if micropython can't support \w I am not sure how to handle it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants