In Python I can use re.findall(pattern, string) to return all non-overlapping matches of pattern in a string.
For example, in the following SVG path command:
import re
spam = "M317.0,169.7C311.1,170.5 285.7,146.8 300.7,178.57 L 321.4,175.01"
eggs = re.findall("([A-Za-z]|-?[0-9]+\.?[0-9]*(?:e-?[0-9]*)?)", spam)
print(eggs)
['M', '317.0', '169.7', 'C', '311.1', '170.5', '285.7', '146.8', '300.7', '178.5', 'L', '321.4', '175.0']
This there a light-weight, clean, and efficient way to do this type of regular expression pattern matching in in C or C++? Please note that I'm not looking for a solution that relies upon Boost. Ideally I would like to minimize dependencies and keep my code lean...