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:

Re:quit command on NT (1997) Price Change (2000) Using Plug-In while running 1.6.1 (1997) Shell script within a sandbox (2005) [recordrank]? (2000) WebCat and PIXO (2000) Truncated numbers (2000) Static pages and store builder (2000) Shopping Cart - prices? (1997) profiles (1999) & in Lookups (1997) ftp access on Macos X (2000) Web Mail (2000) Download URL & access on the fly ? (1997) [WebDNA] How much does it cost now? (2008) What is WebDNA (1997) Is anyone doing USPS shipping? (2003) Frames and WebCat (1997) Set Header Context (1998) Press Release hit the NewsWire!!! (1997)