thanks Spike, it turns out the reference on Evolt is a bit flakey http://www.evolt.org/article/rating/20/22700
It refers to $end while it should be end$, unless off course it just different syntax in CF.... -----Original Message----- From: Spike [mailto:[EMAIL PROTECTED] Sent: Friday, 14 November 2003 9:23 AM To: CFAussie Mailing List Subject: [cfaussie] Re: Calling all RegEx Guru's!!!! That's strange, because the code below works fine for me... <cfset regex = "(\s+|\d+)(streets|street|str|st|roads|road|raod|rd|avenue|ave|av|terrace|tce|corner|cnrdrive|dr|highway|parade|square|lane|place|plc|esplanade|court|plaza|parkway|crescent|way)([^A-Za-z-]*)"> <cfset string = "10 bundaberg street"> <cfset streetType = refindNocase(variables.regex, variables.string, 1, "true")> <cfoutput> #lcase(trim(mid(variables.string, streetType.pos[1], streetType.len[1])))# </cfoutput> Taco Fleur wrote: > Morning Spike, > > No that is not the case, as I said I ran a simple test like below which returned no > result. > > <cfset regExStreetType = "$street"> > <cfset string = "10 bundaberg street"> > <cfset streetType = refindNocase(variables.regExStreetType, > <variables.string, 1, "true")> > > #lcase(trim(mid(variables.string, streetType.pos[1], streetType.len[1])))# > > come over and see for yourself ;-)) > > -----Original Message----- > From: Spike [mailto:[EMAIL PROTECTED] > Sent: Friday, 14 November 2003 9:12 AM > To: CFAussie Mailing List > Subject: [cfaussie] Re: Calling all RegEx Guru's!!!! > > > The problem is that you're requiring that the street type be followed by > at least one dot, space, or comma. > > Since the string you're testing doesn't fulfil that requirement it fails. > > You could try rewriting the regex so the last block reads: > > (\s*|,*|\.*) > > But that might cause issues elsewhere. > > I'd probably try something like: > > ([^A-Za-z-]*) > > That will make sure that the street is not followed by a character or > dash, but may be followed by one or more of anything else including > comma, dot, or space. > > Spike > > > > Taco Fleur wrote: > > >>Morning guys and gals, >> >>I could use a bit of input and help on the following regex which is >>trying to seperate the street types from address records. >> >>(\s+|\d+)((streets|street|str|st)|(roads|road|raod|rd)|(avenue|ave|av)|(terrace|tce)|(corner|cnr)(drive|dr)|(highway)|(parade)|(square)|(lane)|(place|plc)|(esplanade)|(court)|(plaza)|(parkway)|(crescent)|(way))(\s+|,+|\.+) >> >>What it is saying is (I hope) >>There needs to be at least either (one or more spaces OR one or more >>digits) >>Then some variations on street types >>Ending with at least (one space or more OR one or more commas OR one or >>more dots) >> >>What am I missing? >>I have a problem trying to get the values if they are at the end of a >>string, I tried some testing on the following string like so >> >><cfset regExStreetType = "$street"> >><cfset string = "10 bundaberg street"> >><cfset streetType = refindNocase(variables.regExStreetType, >>variables.string, 1, "true")> >> >>#lcase(trim(mid(variables.string, streetType.pos[1], streetType.len[1])))# >> >>But no luck.. >> >>I think I got the PO box pretty well sussed, I know it's not flawless >>but it seems to only retrieve the PO BOx stuff. >><cfset regExPOBox = "\s*PO\s*BOX\s*\d*"> >> >>TIA >> >> >>*Taco Fleur >>07 3535 5072* >>Tell me and I will forget >>Show me and I will remember >>Teach me and I will learn >> >>--- >>You are currently subscribed to cfaussie as: [EMAIL PROTECTED] >>To unsubscribe send a blank email to >>[EMAIL PROTECTED] >>MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia >>http://www.mxdu.com/ + 24-25 February, 2004 > > -- Stephen Milligan Software Architect for http://www.bestrates.com.au MSN: [EMAIL PROTECTED] --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
