jczic / MicroWebSrv2

The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
https://github.com/jczic/MicroWebSrv2
MIT License
662 stars 97 forks source link

Makes the route resolver pattern compatible with MicroPython's re #67

Open Gattag opened 3 years ago

Gattag commented 3 years ago

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

Fixes #38

2e0byo commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

works fine, thank you

2e0byo commented 3 years ago

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.