RE: re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Dan Kaufman
Okay, should we call you Benjamin "little tricks" Bloodworth? Keep those little tricks coming... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Benjamin Bloodworth Sent: Tuesday, September 25, 2007 11:32 AM To: discussion@acfug.org Subject: RE: re[2]:

RE: re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Benjamin Bloodworth
Thanks for the comments. I can't take all the credit though. The coldfusion function is what builds the array. You just have to know the little tricks to get it to return it, like putting parentheses in your regular expression and true as the 4th argument. Benjamin Bloodworth [EMAIL PROTECTED]

RE: re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Dan Kaufman
Benjamin, that is an excellent--and educational--response. I was only following the thread of this post "in the background" and hadn't thought of using an array. Your solution is simple and adaptable. Good work. Dan K -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] O

re[4]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Mischa Uppelschoten ext 10
Excellent. Thanks everybody! Mischa. : : : : #Mid(MyString, MyNumbersArray.pos[1], MyNumbersArray.len[1])# : : That would return the number in the string. The parentheses is the regular : expression groups the result. The + indicates one more numbers in a row. : The number 1 is where to st

RE: re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Benjamin Bloodworth
#Mid(MyString, MyNumbersArray.pos[1], MyNumbersArray.len[1])# That would return the number in the string. The parentheses is the regular expression groups the result. The + indicates one more numbers in a row. The number 1 is where to start the search. True tells cf to return subexpressions

Re: re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Szwedo . Ed
It's finding the POSITION within the string of the first digit. ed -- Ed Szwedo Web Development Team Lead CSC E-mail: [EMAIL PROTECTED] 919-541-3955 (Voice) 919-685-3395 (Fax)

Re: re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Clint . Willard
That will tell you the position where cf found a number. You could then use something like Mid(string, start, count) to return the actual number. Start would be the "22" and count would be how big a number you want, 5 in your case. Then compare that result to 72000 and so on. Sorry I can't give

re[2]: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Mischa Uppelschoten ext 10
Thanks Ben! I'm not a RE wiz, so I'm not sure I understand why REFindNoCase("[0-9]", "ATTN: JOE SMITH PO## 72274"); results in "22"... ? : REFindNoCase("[0-9]", MyString) : You may have to play around with the regular expression some to get exactly : what you want, but that should get you st

RE: [ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Benjamin Bloodworth
REFindNoCase("[0-9]", MyString) You may have to play around with the regular expression some to get exactly what you want, but that should get you started. Benjamin Bloodworth [EMAIL PROTECTED] 850.702.0052 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

[ACFUG Discuss] Finding numbers in strings

2007-09-25 Thread Mischa Uppelschoten ext 10
I thought I once saw a function in CF that would find a numeric part anywhere in a string, but I can't find it anymore (or was I dreaming?) Anyway, here are some sample strings I need to parse: "ATTN: JOE SMITH PO# 72274" "3150 holcomb bridge road" " PO# 72049" " 6311 COURT ST." "PO's 72993,