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 -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/
Associated Messages, from the most recent to the oldest:
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 -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/
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:
RE: Need Help (1998)
Securing/hiding database file (2000)
[WebDNA] WebDNA 7.0 release for the talk-list users (2011)
THANKS (1997)
WebCat2b13MacPlugIn - more [date] problems (1997)
WebDNA-Talk Digest mode broken (1997)
PROBLEMS WITH PROTECT TAG (2004)
checksum for credit cards? (1997)
RequiredFields template (1997)
WebStar Questions ... (2000)
nesting limits? (1998)
Classified (1999)
off-topic: SMS interface? (2001)
Deleting Orders (1997)
WebCat editing, SiteGuard & SiteEdit (1997)
can WC render sites out? (1997)
Trigger Output (2003)
many-to-one problem (1998)
WebCatalog and WebTen (1997)
WCf2 and nested tags (1997)