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:

form crasehes server (1997) Sort Order on a page search (1997) Capitalize special cases (2000) CAPTCHA system in webDNA (2005) [WebDNA] Installing 6.0 onto Server 2008 (2011) Problems with [Search] param - Mac Plugin b15 (1997) multi-paragraph fields (1997) More on the email templates (1997) upgrading (1997) Search returns all, not 20 (1997) Grep and removing text (2002) Test (2003) Word Breaks (1998) Re:no [search] with NT (1997) Running 2 two WebCatalog.acgi's (1996) [WebDNA] Open Source CMS (2012) show all problem (1997) [OT] ISP Windows program (2005) Typhoon Rev. and PCS store problems (1999) [WebDNA] Google Map Mashup available at webdna.us (2010)