Re: [WebDNA] ONLY the FIRST continuous run of numeric chars?

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101222
interpreted = N
texte = all listening to this thread :-), I see what you were suggesting Stuart (see below). Gary I did not get your drift... you put the whole match into one subpattern which then does not allow me to extract out JUST the number. Did you try either of those suggestions? Anyway, using Stuart's idea, I notice this: (notice [middle] doesn't stop on the first occurrence of "X"!?, thus the need for two layers of [middle]... but then imagine the user input (for [myString]) 3 different continuous runs of numbers... We're getting to a recursive loop/include/middle just to grab the FIRST run of continuous numeric chars, which is ridiculous! this: myString=[text show=T]myString=1155 Bluebridge, apt.#2[/text]
OldGrepDoesThis=[grep search=([^0-9]*)([0-9][0-9]*)([^0-9]*)&replace= \2][myString][/grep]
Grep1DoesThis=[text show=T]Grep1DoesThis=[grep search=([^0-9]*)([0-9] [0-9]*)([^0-9]*)&replace=\2X][myString][/grep][/text]
middleDoesThis=[Middle StartAfter=&EndBefore=X][Grep1DoesThis][/ Middle]
DoubleMiddleDoesThis=[Middle StartAfter=&EndBefore=X][Middle StartAfter=&EndBefore=X][Grep1DoesThis][/Middle][/Middle] returns: myString=1155 Bluebridge, apt.#2 OldGrepDoesThis=11552 Grep1DoesThis=1155X2X middleDoesThis=1155X2 DoubleMiddleDoesThis=1155 -Govinda On Oct 20, 2008, at 3:44 PM, Stuart Tremain wrote: > > I haven't tested this, but give it a go > > [Middle EndBefore=X][grep search=([^0-9]*)([0-9][0-9]*) > ([^0-9]*)&replace=X][myString][/grep][/Middle] > > > > > > On 21/10/2008, at 8:35 AM, 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 >> >> Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("William DeVaul" 2008)
  2. RE: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("Michael A. DeLorenzo" 2008)
  3. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Matthew Bohne 2008)
  4. RE: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("Michael A. DeLorenzo" 2008)
  5. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Gary Krockover 2008)
  6. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Matthew Bohne 2008)
  7. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  8. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("William DeVaul" 2008)
  9. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  10. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("William DeVaul" 2008)
  11. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  12. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  13. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("Gary Krockover" 2008)
  14. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  15. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Patrick McCormick 2008)
  16. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Terry Wilson 2008)
  17. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Charles Kline 2008)
  18. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("Gary Krockover" 2008)
  19. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("Gary Krockover" 2008)
  20. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Stuart Tremain 2008)
  21. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  22. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Stuart Tremain 2008)
  23. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? ("William DeVaul" 2008)
  24. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
  25. Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? (Stuart Tremain 2008)
  26. [WebDNA] ONLY the FIRST continuous run of numeric chars? (Govinda 2008)
all listening to this thread :-), I see what you were suggesting Stuart (see below). Gary I did not get your drift... you put the whole match into one subpattern which then does not allow me to extract out JUST the number. Did you try either of those suggestions? Anyway, using Stuart's idea, I notice this: (notice [middle] doesn't stop on the first occurrence of "X"!?, thus the need for two layers of [middle]... but then imagine the user input (for [myString]) 3 different continuous runs of numbers... We're getting to a recursive loop/include/middle just to grab the FIRST run of continuous numeric chars, which is ridiculous! this: myString=[text show=T]myString=1155 Bluebridge, apt.#2[/text]
OldGrepDoesThis=[grep search=([^0-9]*)([0-9][0-9]*)([^0-9]*)&replace= \2][myString][/grep]
Grep1DoesThis=[text show=T]Grep1DoesThis=[grep search=([^0-9]*)([0-9] [0-9]*)([^0-9]*)&replace=\2X][myString][/grep][/text]
middleDoesThis=[Middle StartAfter=&EndBefore=X][Grep1DoesThis][/ Middle]
DoubleMiddleDoesThis=[Middle StartAfter=&EndBefore=X][Middle StartAfter=&EndBefore=X][Grep1DoesThis][/Middle][/Middle] returns: myString=1155 Bluebridge, apt.#2 OldGrepDoesThis=11552 Grep1DoesThis=1155X2X middleDoesThis=1155X2 DoubleMiddleDoesThis=1155 -Govinda On Oct 20, 2008, at 3:44 PM, Stuart Tremain wrote: > > I haven't tested this, but give it a go > > [Middle EndBefore=X][grep search=([^0-9]*)([0-9][0-9]*) > ([^0-9]*)&replace=X][myString][/grep][/Middle] > > > > > > On 21/10/2008, at 8:35 AM, 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 >> >> Govinda

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:

[WebDNA] how to make webroot the start of path (2017) Browser Caching (2003) [ShowCart]-- was ThankYou page problems (1997) [quantity] within formulas (1997) Bulletin Board (1998) WebCat2: Items xx to xx shown, etc. (1997) pop up menu's (1998) [WriteFile] problems (1997) WC 2.0 frames feature (1997) how to use encrypt and searching (1998) wrong input values? (1997) Re:HTTP header line is too long? (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) downloading binary files ussing mime and tcpconnect (2004) Problems with date math (1997) Missing Cart Information (2003) Re:quit command on NT (1997) Date Sorting (1997) WebCat B13 Mac CGI -- Frames question (1997) Sorting by date (1997)