M
Miki Tebeka
Hello All,
In a configuration file there can be ID's and filename tokens.
The file names have a known suffix (.o or .mls) and I need to get a regular
expression that will catch filename but not an ID.
Currently:
ID = r"[a-zA-Z\.]\w+(?![/\\])"
FILENAME = r"([a-zA-Z]?[\w./\\]+\.((mls)|(o))"
However if I have the filename "Sources/kernel/rom_kernel.mls" then
"Source" is interrupted as ID and "s/kernel/rom_kernel.mls" is interrupted
as file name.
Any way to do better?
BTW: I'm using PLY (http://systems.cs.uchicago.edu/ply/) for parsing.
Bye.
In a configuration file there can be ID's and filename tokens.
The file names have a known suffix (.o or .mls) and I need to get a regular
expression that will catch filename but not an ID.
Currently:
ID = r"[a-zA-Z\.]\w+(?![/\\])"
FILENAME = r"([a-zA-Z]?[\w./\\]+\.((mls)|(o))"
However if I have the filename "Sources/kernel/rom_kernel.mls" then
"Source" is interrupted as ID and "s/kernel/rom_kernel.mls" is interrupted
as file name.
Any way to do better?
BTW: I'm using PLY (http://systems.cs.uchicago.edu/ply/) for parsing.
Bye.