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

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101233
interpreted = N
texte = Did I miss this somewhere in the docs in plain English? I thought we were mostly limited to the commands, params, etc. in the WebDNA programmer guide...... I have now seen the light. -----Original Message----- From: Matthew Bohne [mailto:matthew.bohne@benetela.com] Sent: Tuesday, October 21, 2008 1:59 PM To: talk@webdna.us Subject: Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? The O'Reilly Pocket Guide for Regular Expressions is a handy reference in these situations. [^0-9]* - any character except a number followed by one or more of the same character ([0-9][0-9]*) - two or more numbers followed by one or more of the same character. - The parenthesis mark it for the \1 in the replace statement. .* - Any character (except line breaks) followed by one or more of the same character | - OR .* - Any character (except line breaks) followed by one or more of the same character. It then replaces it with whatever was found in the parenthetical set. If no number strings were found by themselves, it returns blank. Govinda wrote: > Perfect!! > > When I saw Grant was writing [grep] for v.4 I remember thinking, "if > he and we get this right, then we'll forget many other tags as this > can solve so many things." > I suppose both side are still aiming for that. ;-) > In that spirit, Bill can you explain this last [grep] search param you > wrote in english? What is the logic? > I get the first two parts, i.e.: > -any number of non-numeric chars, followed by > -at least one numeric char, followed by > ((now here is where it is not clear to me)) > ? - any number of any chars, followed by > ? - a pipe, followed by > ? - any number of any chars > > why does this do the job? > > On Oct 21, 2008, at 2:32 AM, William DeVaul wrote: > >> [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. >> > --------------------------------------------------------- > 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/ > > --------------------------------------------------------- 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:

    
  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)
Did I miss this somewhere in the docs in plain English? I thought we were mostly limited to the commands, params, etc. in the WebDNA programmer guide...... I have now seen the light. -----Original Message----- From: Matthew Bohne [mailto:matthew.bohne@benetela.com] Sent: Tuesday, October 21, 2008 1:59 PM To: talk@webdna.us Subject: Re: [WebDNA] ONLY the FIRST continuous run of numeric chars? The O'Reilly Pocket Guide for Regular Expressions is a handy reference in these situations. [^0-9]* - any character except a number followed by one or more of the same character ([0-9][0-9]*) - two or more numbers followed by one or more of the same character. - The parenthesis mark it for the \1 in the replace statement. .* - Any character (except line breaks) followed by one or more of the same character | - OR .* - Any character (except line breaks) followed by one or more of the same character. It then replaces it with whatever was found in the parenthetical set. If no number strings were found by themselves, it returns blank. Govinda wrote: > Perfect!! > > When I saw Grant was writing [grep] for v.4 I remember thinking, "if > he and we get this right, then we'll forget many other tags as this > can solve so many things." > I suppose both side are still aiming for that. ;-) > In that spirit, Bill can you explain this last [grep] search param you > wrote in english? What is the logic? > I get the first two parts, i.e.: > -any number of non-numeric chars, followed by > -at least one numeric char, followed by > ((now here is where it is not clear to me)) > ? - any number of any chars, followed by > ? - a pipe, followed by > ? - any number of any chars > > why does this do the job? > > On Oct 21, 2008, at 2:32 AM, William DeVaul wrote: > >> [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. >> > --------------------------------------------------------- > 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/ > > --------------------------------------------------------- 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/ "Michael A. DeLorenzo"

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:

Showif, Hideif reverse logic ? (1997) no [search] with NT (1997) Stop page auto. refreshing (2004) Variable Prices (1998) Multiple fields on 1 input (1997) [protect] (2000) docs for WebCatalog2 (1997) Seeking Better Display of results... (1997) FM and Webcat together? (1998) shipping code (1998) counting characters and/or words (1997) E-Mail (1998) greater than or equal to (1997) Frames and WebCat (1997) Simple way to create unique SKU (1997) OT: Unix talk deamon (2004) still having shipCost.db Problem (1997) WebCat editing, SiteGuard & SiteEdit (1997) SFTP (2004) WebDNA to PHP (2008)