On Mon, Aug 4, 2008 at 4:54 PM, Sriram Rajan <sriramrajan@ac m.orgwrote:
Something like below?
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'
--
Stand Fast,
tjg. [Timothy Grant]
I am wondering if I can use re.search to extract from a particular
location in a string.
Example:
string1='/Users/sriram/folder1/folder2/folder3/folder4/folder5/file'
re.search ('folder3,strin g1)
>
<Extract /folder3/folder4/folder5/file>
>
Thanks,
>
Sriram
location in a string.
Example:
string1='/Users/sriram/folder1/folder2/folder3/folder4/folder5/file'
re.search ('folder3,strin g1)
>
<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.
>>import re
>>s = '/Users/sriram/folder1/folder2/folder3/folder4/folder5/file'
>>y = re.search('fold er3.*', s)
>>y.group()
>>s = '/Users/sriram/folder1/folder2/folder3/folder4/folder5/file'
>>y = re.search('fold er3.*', s)
>>y.group()
>>>
--
Stand Fast,
tjg. [Timothy Grant]