Reg Ex help
aaronb at mrxfx.com
Thu May 11 19:58:24 CEST 2006
there may well be a better way then regex, although I find them usefull
and use them a lot.
The way they work would be dependant on knowing some things. For
example, if the dir you are after is always 4
deep in the structure you could try something like...
p = re.compile('/\S*/\S*/\S*/(\S*)/')
m = re.search(p, path)
This is a good reference...
Hope that helps,
>I have a string from a clearcase cleartool ls command.
>I want to write a regex that gives me the branch the file was
>checkedout on ,in this case - 'dbg_for_python'
>Also if there is a better way than using regex, please let me know.
>Thanks in advance,
More information about the Python-list