Hi, On 5 May 2011 17:19, Mike Adams <[email protected]> wrote: > Using this tool: > http://www.spaweditor.com/scripts/regex/index.php > > Using this regex: > /(\s[r|rural]+\s?[d|delivery]+\s*\d)/i >
- are you sure there is always a space before "r" or "rural" what about "2 West coast,rural delivery" > Using this sample data set: > " > 2 West coast, Rural delivery 1 > 20 West Coast Road, RD2 > 222 Hard Road, RD 3, Tiparere > 3 hard 11 hard > 33 ford road rural Delivery 3 > 1 fords road rd 1 > 5 foo rd > 6 left road rUrAl DeLiVeRy 2 > " > > Q1 ? > Setting "preg_match_all" i am getting one false positive to sort out. > That is across two lines. It is the "rd" at the end of "5 foo rd" and the 6 > starting the next line. You could try to put ".*?$" at the end, outside of your brackets, it means "any sort of character or none before the end of line" > > Q2? > Not sure why i get each result twice. > What matching option are you using PREG_MATCH_SET? Can you post your code and the print_r result? HTH, Jochen > TIA > > -- > NZ PHP Users Group: http://groups.google.com/group/nzphpug > To post, send email to [email protected] > To unsubscribe, send email to > [email protected] -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected]
