brython-dev / brython

Brython (Browser Python) is an implementation of Python 3 running in the browser
BSD 3-Clause "New" or "Revised" License
6.4k stars 512 forks source link

Bug with non-greedy modifier in regular expressions #2490

Closed alextretyak closed 2 months ago

alextretyak commented 2 months ago
import re
re.sub(r'/\*(.|\n)*?\*/', '', 'a/*b*/.../*c*/d')

outputs 'ad', but the correct Python implementation outputs 'a...d'.

PierreQuentel commented 2 months ago

Thanks Alexander !