Re: grep question - removing spaces

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 61861
interpreted = N
texte = Multiple greps may work, but it is harder to maintain the code. The original grep should work, but there is something that is causing the parser to accept the space. This means it is falling into one of the acceptable criteria. Try: [text]anytext=-_ABC-_123 $%#[/text] grep 1= [grep search=[^-_a-zA-Z0-9]&replace=][anytext][/grep]
grep 2= [grep search=[^a-zA-Z0-9_-]&replace=][anytext][/grep]
grep 3= [grep search=[^a-zA-Z0-9_[URL]-[/URL]]&replace=][anytext][/grep]
grep 4= [grep search=[^a-zA-Z0-9[URL]_-[/URL]]&replace=][anytext][/grep]
grep 5= [grep search=[^\-\_a-zA-Z0-9]&replace=][anytext][/grep]
grep 6= [grep search=[^a-zA-Z0-9\_\-]&replace=][anytext][/grep]
grep 7= [grep search=[^a-zA-Z0-9\_-]&replace=][anytext][/grep]
grep 8= [grep search=[^a-zA-Z0-9_\-]&replace=][anytext][/grep]
grep 9= [grep search=[^a-zA-Z0-9\-\_]&replace=][anytext][/grep]
grep 10= [grep search=[^a-zA-Z0-9-_]&replace=][anytext][/grep]
A grep that works for you will return: "-_ABC-_123" My test shows 5, 9, and 10 do not work. I can't tell why for sure, but 5 and 9 use \-. I'd avoid that. URL or putting the dash first or last seem to work. If webdna grep is not working, can you drop in a shell and use the command line grep or perl? Bill -----Original Message----- From: Marc Thompson Sent: Tue, 26 Apr 2005 10:57:20 -0600 To: "WebDNA Talk" Subject: Re: grep question - removing spaces I've also found that sometimes I need to grep consecutively, not trying to get everything out with a single statement. This grep removes space characters for me: [Grep search= &replace=][/grep] Marc ------------------------------------------------------------- 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 question - removing spaces ( Clint Davis 2005)
  2. Re: grep question - removing spaces ( devaulw@onebox.com 2005)
  3. Re: grep question - removing spaces ( devaulw@onebox.com 2005)
  4. Re: grep question - removing spaces ( "Dale's eLists" 2005)
  5. Re: grep question - removing spaces ( Marc Thompson 2005)
  6. Re: grep question - removing spaces ( Marc Thompson 2005)
  7. Re: grep question - removing spaces ( devaulw@onebox.com 2005)
  8. Re: grep question - removing spaces ( "Dale's eLists" 2005)
  9. Re: grep question - removing spaces ( devaulw@onebox.com 2005)
  10. grep question - removing spaces ( "Dale's eLists" 2005)
Multiple greps may work, but it is harder to maintain the code. The original grep should work, but there is something that is causing the parser to accept the space. This means it is falling into one of the acceptable criteria. Try: [text]anytext=-_ABC-_123 $%#[/text] grep 1= [grep search=[^-_a-zA-Z0-9]&replace=][anytext][/grep]
grep 2= [grep search=[^a-zA-Z0-9_-]&replace=][anytext][/grep]
grep 3= [grep search=[^a-zA-Z0-9_[url]-[/URL]]&replace=][anytext][/grep]
grep 4= [grep search=[^a-zA-Z0-9[url]_-[/URL]]&replace=][anytext][/grep]
grep 5= [grep search=[^\-\_a-zA-Z0-9]&replace=][anytext][/grep]
grep 6= [grep search=[^a-zA-Z0-9\_\-]&replace=][anytext][/grep]
grep 7= [grep search=[^a-zA-Z0-9\_-]&replace=][anytext][/grep]
grep 8= [grep search=[^a-zA-Z0-9_\-]&replace=][anytext][/grep]
grep 9= [grep search=[^a-zA-Z0-9\-\_]&replace=][anytext][/grep]
grep 10= [grep search=[^a-zA-Z0-9-_]&replace=][anytext][/grep]
A grep that works for you will return: "-_ABC-_123" My test shows 5, 9, and 10 do not work. I can't tell why for sure, but 5 and 9 use \-. I'd avoid that. URL or putting the dash first or last seem to work. If webdna grep is not working, can you drop in a shell and use the command line grep or perl? Bill -----Original Message----- From: Marc Thompson Sent: Tue, 26 Apr 2005 10:57:20 -0600 To: "WebDNA Talk" Subject: Re: grep question - removing spaces I've also found that sometimes I need to grep consecutively, not trying to get everything out with a single statement. This grep removes space characters for me: [Grep search= &replace=][/grep] Marc ------------------------------------------------------------- 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/ devaulw@onebox.com

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:

TCPConnect to query for Domain expiration (2000) WebTen? (1997) WebCat2 - Getting to the browser's username/password data (1997) Tab Charactor (1997) Understanding texta (1997) Missing something simple? (1999) Bug Report, maybe (1997) Deleting Orders (1997) Looking for a special Image Upload Script (2004) RE: (1997) Help w/ Duplicating The General Store 5 times. (1997) [WebDNA] Competitors! (2008) Looking for WebDNA calendar (2004) [WebDNA] Bug in [thisurlplusget] on v7 (2011) WebCatalog 4.0 has been released! (2000) problems with WebCat-Plugin () Founditems context returning only 1 item (1997) Errata: WCS Newbie question (1997) [Fwd: F3 database munching] (1997) New commands in Final candidate (1997)