Re: [WebDNA] ONLY the FIRST continuous run of numeric chars?
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 101228
interpreted = N
texte = [grep search=[^0-9]*([0-9][0-9]*).*|.*&replace=\1][myString][/grep]This will work to ignore the case where no number is in the string.It will return an apartment number if there is no street number.On Tue, Oct 21, 2008 at 12:16 AM, Govinda
wrote:> Bill,>> that is the best behaved [grep] yet for this problem!> Thanks.>> Note though, that if there are NO numbers in [myString], then it returns the> whole string... (sigh). (And I was bad enough at the regex engines that> behave as expected!)>> for the final check I am just multiplying the result of the [grep] by zero> and seeing if the result = 0 ==> i.e. we have a number.>> On Oct 20, 2008, at 8:22 PM, William DeVaul wrote:>>> [text show=F]myString=1155 Bluebridge, apt.#2[/text]>> [grep search=[^0-9]*([0-9][0-9]*).*&replace=\1][myString][/grep]>>>> The above works in the situation you've described, namely the first>> number of 1 or more digits returned and nothing else.>>>> I'm not sure why you wanted the other text for back reference.>>>> To the question below, WebDNA regex does not handle one or more, i.e.>> +, the way you'd expect. The workaround is to repeat the reference.>>>> Bill>>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/>
Associated Messages, from the most recent to the oldest:
[grep search=[^0-9]*([0-9][0-9]*).*|.*&replace=\1][myString][/grep]This will work to ignore the case where no number is in the string.It will return an apartment number if there is no street number.On Tue, Oct 21, 2008 at 12:16 AM, Govinda wrote:> Bill,>> that is the best behaved [grep] yet for this problem!> Thanks.>> Note though, that if there are NO numbers in [myString], then it returns the> whole string... (sigh). (And I was bad enough at the regex engines that> behave as expected!)>> for the final check I am just multiplying the result of the [grep] by zero> and seeing if the result = 0 ==> i.e. we have a number.>> On Oct 20, 2008, at 8:22 PM, William DeVaul wrote:>>> [text show=F]myString=1155 Bluebridge, apt.#2[/text]>> [grep search=[^0-9]*([0-9][0-9]*).*&replace=\1][myString][/grep]>>>> The above works in the situation you've described, namely the first>> number of 1 or more digits returned and nothing else.>>>> I'm not sure why you wanted the other text for back reference.>>>> To the question below, WebDNA regex does not handle one or more, i.e.>> +, the way you'd expect. The workaround is to repeat the reference.>>>> Bill>>> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/>
"William DeVaul"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Extended [ConvertChars] (1997)
Combining search criteria in a context? (1998)
customer info (2001)
syntax question, not in online refernce (1997)
[WebDNA] Feature Request: [returnhtml] (2016)
Variables not being passed *back* (2000)
Quantity * price (1997)
StandardConversions.db (1998)
New command suggestion (was Modifying databasesmanually) (1997)
ShipCost Data Base (1998)
WebCat2: Formulas.db question (1997)
Listwords and the & (2001)
RE: [WebDNA] File Include HTM (2008)
item sorting (1997)
Creating folders and deleting files (1997)
WC Database Format (1997)
[OT] Mail Error code 573?? (2006)
[WebDNA] =?utf-8?B?UmU6IFtXZWJETkFdIFBERiBjcmVhdGlvbg==?= (2013)
I'm new (2001)
Removing [showif] makes a big difference in speed (1997)