At 05:40 PM 11/28/2005 -0800, Wong, Danny H. wrote: >$String = 'Integration Test Lead: \ul\b0 \tab\tab\tab Kimberly >Kim\tab\tab\tab\tab\tab\tab \par'; > >How would I extract "Kimberly Kim" from the string using regular >expression. Is there a way using expression to skip "\[characters]" ( >like \tab ) and search for only real words, maybe between spaces.
So u want to be able to search for multi word strings, that may or may not be interrupted by whitespace or other junk characters? $match = $string =~ m/(Kimberly\W*\s\W*Kim)/s; @match = $string =~ m/(Kimberly)\W*\s\W*(Kim)/s; @match = $string =~ m/($firstname)\W*\s\W*($lastname)/s; ($firstname, $lastname) = $string =~ m/($firstname)\W*\s\W*($lastname)/s; \s is whitespace and \W is any non alphanumeric garbage. If any high ASCII characters are valid name letters it's a little more complicated but basically the same format. -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede malis" 00000100 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs