Comment

Comment by lengads

re.findall() returns all non-overlapping matches. We need to use a positive lookahead on the third part of the pattern to stop it from consuming the non-character:

  re.findall(r"[^a-zA-Z]([a-zA-Z]+)(?=[^a-zA-Z])", ..)
parent lengads 13 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton