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:
Comments in db? (1997)
WebDNS and RSS (2003)
Help Wanted - Stowe, Vermont (1999)
Need help with search title (1998)
no template caching (1997)
The EMailer and the Blank menu bar? (1999)
More Shopping Cart Problems (2000)
[append] vs. [appendfile] delta + question? (1997)
WebCat2_Mac RETURNs in .db (1997)
Automated FTP from Shell (2004)
Head's up to SMSI ... (2003)
RE: E-mailer error codes (1997)
Install problems on 3.08 (2000)
(1997)
WebCat2 - storing unformatted date data? (1997)
All orders are failing (2002)
reservation program (2000)
WebCatalog can't find database (1997)
Page-Execution-Timer...PHP vs WebDNA (2004)
Extended [ConvertChars] (1997)