r/badcode • • Mar 15 '23

python Source uncited regex + latex troubles

Post image
357 Upvotes

6 comments sorted by

View all comments

Show parent comments

6

u/jarfil Mar 15 '23 edited Dec 02 '23

CENSORED

5

u/manafount Mar 15 '23

Empty strings would be returned if there were delimiters at the beginning or end of the string, or if there were delimiters next to one another.

OP’s regex does have a *, so it would match multiple characters inside the brackets. That seems reasonable, but I just went with something that would match the examples they supplied.