Grep Problems

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 62747
interpreted = N
texte = I need to extract the five digit number between the pipes in the following string: XXL - White|90140|1- I can get this to work using the following grep search in a text editor (BBEdit), but not in WebDNA 6.x: (\|)([0-9]+)(\|) The following WebDNA code does *NOT* work: [grep search=(\|)([0-9]+)(\|)&replace=\2]XXL - White|90140|1-[/grep] It seems that WebDNA won't accept multiple patterns. So, how could I use grep to remove the leading and trailing characters so that the result is: 90140 I tried this with no success: [grep search=[a-zA-Z\s\-]*\|&replace=]XXL - White|90140|1-[/grep] ??? ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Grep Problems ( Clint Davis 2005)
  2. Re: Grep Problems ( Gary Krockover 2005)
  3. Re: Grep Problems ( Donovan Brooke 2005)
  4. Grep Problems ( Clint Davis 2005)
I need to extract the five digit number between the pipes in the following string: XXL - White|90140|1- I can get this to work using the following grep search in a text editor (BBEdit), but not in WebDNA 6.x: (\|)([0-9]+)(\|) The following WebDNA code does *NOT* work: [grep search=(\|)([0-9]+)(\|)&replace=\2]XXL - White|90140|1-[/grep] It seems that WebDNA won't accept multiple patterns. So, how could I use grep to remove the leading and trailing characters so that the result is: 90140 I tried this with no success: [grep search=[a-zA-Z\s\-]*\|&replace=]XXL - White|90140|1-[/grep] ??? ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Clint Davis

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:

Running 2 two WebCatalog.acgi's (1996) RE: WebDNA-Talk searchable? (1997) Simple way to create unique SKU (1997) search form problem.. (1997) WebCat2b13MacPlugIn - syntax to convert date (1997) download a file (2001) Protecting Realms (1998) WC 4.02rc2 (2001) setlineitem quantity to zero? (2000) Unsibscribe Was: UPS uber integration (2007) Running 2 two WebCatalog.acgi's (1996) RE: [WebDNA] SHA-512 How To Do It (2014) Mac Webcat 3.0.3b1 memory leak redirect inside search (1998) Why would prices no appear in cart (2000) Format of Required fields error message (1997) [WebDNA] Email not going out, error 554 (2016) WebCat2 several catalogs? (1997) [WebDNA] [OT] thanks. (2009) LookUp Tag (1997) Editing the search string (1997)