I would like to write a regular expression in Python that is a formatted string and includes a unicode category.
The regex would look like this:
import regex as re
mystring = "abc"
m = re.search(rf"^{mystring}p{L}", "abcD")
However, this cannot work as the {L}
is treated as a formatting placeholder (NameError: name 'L' is not defined
)
Is there a way to create regular expressions with both constraints ?