Oh guess it would be even better and faster to only use:

/Last Name:([^\n]*)/

and trim() the result :-)

 -- red

Red Wingate wrote:

Yep, but to avoid his problem with empty Strings he should use
something like:

/Last Name: *(.*?)\n/

outerwise \s* will match the first newline and continue to the end
of the next line !

Tim Van Wassenhove wrote:

In article <[EMAIL PROTECTED]>, Arik Raffael Funke wrote:

implement following pattern "Last Name:\s*(.*)\n".



I get just 'Jason'. But what I currently get is:
Jason
Street: abc



This is behaviour because (.*) is greedy. As you noticed, it matched "Jason \nStreet:abc"

/Last Name:\s+(.*?)\n/



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to