Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
angara
· 7y ago · 0 comments
Regular expressions are also useful for lexing. I like to work from this example code from the Python standard library docs:
https://docs.python.org/3.6/library/re.html#writing-a-tokeni...
Comments
[–]
fanf2
7y ago
Remember, `lex` is just a pile of regular expressions, so it is great for simple parsing in C. There are good reasons it was known as the Swiss Army knife of Unix before scripting took over :-)