I am wondering if I can use re.search to extract from a particularSomething like below?
location in a string.
Example:
string1='/Users/sriram/folder1/folder2/folder3/folder4/folder5/file'
re.search ('folder3,string1)
<Extract /folder3/folder4/folder5/file>
Thanks,
Sriram
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:16)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
'folder3/folder4/folder5/file'>>import re
s = '/Users/sriram/folder1/folder2/folder3/folder4/folder5/file'
y = re.search('folder3.*', s)
y.group()
>>>
--
Stand Fast,
tjg. [Timothy Grant]