Re: [WebDNA] ONLY the FIRST continuous run of numeric chars?
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 101226
interpreted = N
texte = [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 firstnumber 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.BillOn Mon, Oct 20, 2008 at 5:35 PM, Govinda
wrote:> I appreciate your time/effort Bill and Stuart!>> I am still stuck on this though, and I think the issue is on the side of> WebDNA...>> OK, real simple, from the top:>> this:> [text show=F]myString=1155 Bluebridge, apt.#2[/text]> [grep search=([^0-9]*)([0-9][0-9]*)([^0-9]*)&replace=\2][myString][/grep]>> is returning this:> 11552>> I only want "1155". Can I do that with [grep]?>> -G>> On Oct 20, 2008, at 2:36 PM, William DeVaul wrote:>>> You are matching zero numbers in the middle parens.>>>> search=([^0-9]*)([0-9][0-9]*)([^0-9]*)>>>> Should work with the WebDNA regex engine. In another engine, the>> second * would be + (one or more).>>>> 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:
[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 firstnumber 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.BillOn Mon, Oct 20, 2008 at 5:35 PM, Govinda wrote:> I appreciate your time/effort Bill and Stuart!>> I am still stuck on this though, and I think the issue is on the side of> WebDNA...>> OK, real simple, from the top:>> this:> [text show=F]myString=1155 Bluebridge, apt.#2[/text]> [grep search=([^0-9]*)([0-9][0-9]*)([^0-9]*)&replace=\2][myString][/grep]>> is returning this:> 11552>> I only want "1155". Can I do that with [grep]?>> -G>> On Oct 20, 2008, at 2:36 PM, William DeVaul wrote:>>> You are matching zero numbers in the middle parens.>>>> search=([^0-9]*)([0-9][0-9]*)([^0-9]*)>>>> Should work with the WebDNA regex engine. In another engine, the>> second * would be + (one or more).>>>> 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:
[include] affect on filepaths for links? (1997)
Bug? (1997)
WebDNA hosting? ... (2004)
No Line Breaks from OSX server (2002)
More WebMerch<->MacAuthoriz (1997)
FWD: WebCatalog and .TMPL (1997)
[shell] (2002)
[WebDNA] Suggested Platform (2013)
Different Tax levels (1998)
Separate SSL Server (1997)
Practice runs ? (1997)
[OT] (waaaay OT) (2004)
Upgrading old WebCat Database Files (1997)
cookie length (1998)
Changes to the List (1997)
SiteGuard Admin Feature ? (1997)
users.db (1999)
How To question on setting up downloads (1997)
Webcat2, WebCommerce, Mod 10 etc. (1997)
list cookies and list http headers (1997)