Regular expression parsing
My input is a regular expression, for example: [0-]\sbla\scd\s\^a
I want to get the unchangeable strings. The output f开发者_开发问答or the example would be:
bla
cd
^a
Does anyone know about a program which does that, source code would be helpful. (it's not homework :)
You should look at the code of a regex parser. It would get the "unchangeable" strings while parsing. If it expose the parsing tree, you can have what you want. it would be better than writing your own parser ...
Try the source of something like libregex :)
my two cents.
精彩评论