develooper Front page | perl.beginners | Postings from March 2002

limiting a regular expression

Thread Next
From:
Zysman, Roiy
Date:
March 16, 2002 22:45
Subject:
limiting a regular expression
Message ID:
1FA73BCBB3CFD311913100A0C9E00BE601DF33E8@hasmsx43.iil.intel.com
Hi All,
As we all know Regular Expressions are very greedy and tries to big as big
as possible.
How do i limit a regular expression for example ion the follwing case
 
i try to find a specific directory called tmp_* in some paths which are like
this
 
/dir1/dir2/dir3/tmp_test1/dir4/dir5.../.../...
/dir6/dir7/dir8/tmp_test2/dir9/dir10../.../..../...
 
if i use (\S+) it will also catch the following dirs, even if i use (\S+)\/
Any suggestions ?
Thx Roiy
 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About