Re: grep question - removing spaces
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 61863
interpreted = N
texte = Sorry for replying to my own message, but using[text]anytext=-_ABC-_123 $%#\ _-[/text]shows that 5-10 also accept a \ character. I'd stick with examples 1-4 as working examples for now. In sum, [URL] the - or put it first or last. A \ preceding the - seems to mean the \ does not modify the next character. Bill-----Original Message-----From: devaulw@onebox.comSent: Tue, 26 Apr 2005 13:42:16 -0400To: "WebDNA Talk"
Subject: Re: grep question - removing spacesMultiple 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 -0600To: "WebDNA Talk" Subject: Re: grep question - removing spacesI'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/-------------------------------------------------------------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:
Sorry for replying to my own message, but using[text]anytext=-_ABC-_123 $%#\ _-[/text]shows that 5-10 also accept a \ character. I'd stick with examples 1-4 as working examples for now. In sum, [url] the - or put it first or last. A \ preceding the - seems to mean the \ does not modify the next character. Bill-----Original Message-----From: devaulw@onebox.comSent: Tue, 26 Apr 2005 13:42:16 -0400To: "WebDNA Talk" Subject: Re: grep question - removing spacesMultiple 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 -0600To: "WebDNA Talk" Subject: Re: grep question - removing spacesI'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/-------------------------------------------------------------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:
HTML Editors (1997)
Multiple Stores and WebCatalog Prefs (1997)
Obscure Question of the day (1997)
Nesting format tags (1997)
[defined]ish (1997)
RequiredFields template (1997)
Validation (2000)
Date format problems (1997)
redirect with frames (1997)
WC TableGrinder (1997)
shipcost (1997)
Enhancement Request for WebCatalog-NT (1996)
PIXO (1997)
no template caching (1997)
Multiple catalog databases and showcart (1997)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
If Empty ? (1997)
[protect] on NT? (1997)
Date problems (1997)
OT - SMSI complaint (2001)