Re: [WebDNA] can webdna's [grep] find and replace ONLY the literal "+" char?

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 109022
interpreted = N
texte = --Apple-Mail-41--1002622787 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > I found this from an old note: >=20 > It seems in webdna's grep.. that the "+" char can go anywhere that = makes sense *except* at the end of the Character Class (which causes the = whole script to fail) (reason??). from here: = --------------------------------------------------------------------------= -------------------------------------- = --------------------------------------------------------------------------= -------------------------------------- From: Govinda Subject: Re: [WebDNA] GREP problem Date: 2011-04-21 11:53:44 AM EDT To: WebDNA talk Hi Stuart I got this to work for you: = --------------------------------------------------------------------------= -------------- = [text]incomingString=3Dabcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+`-=3D{}|[]\:= ";'<>?,./=20 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[/text] [text]cleanedString=3D[grep = search=3D[URL][^a-zA-Z0-9_+-][/URL]&replace=3D][incomingString][/grep][/te= xt] incomingString=3D[incomingString]
cleanedString=3D[cleanedString]
= --------------------------------------------------------------------------= -------------- It seems in webdna's grep.. that the "+" char can go anywhere that makes = sense *except* at the end of the Character Class (which causes the = whole script to fail) (reason??). Also if I did not wrap the search string with [URL], then that also = failed in the sense that the + was not treated as a literal "+". (Lucky us in this case we did not need the "+" to behave as a = quantifier char, which may have opened up another can of worms.) -G = --------------------------------------------------------------------------= -------------------------------------- = --------------------------------------------------------------------------= -------------------------------------- --Apple-Mail-41--1002622787 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

I found this from an old = note:

It seems in webdna's grep.. that the "+" char can = go anywhere that makes sense *except* at the end of the Character Class = (which causes the whole script to fail) = (reason??).

from = here:

-------------------------------------------= ---------------------------------------------------------------------
--------------------------------------------------------------------= --------------------------------------------

= From: = Govinda   <govinda.webdnatalk@gmail.com<= /a>>

Hi Stuart

I got this to work = for = you:

--------------------------------------------------------------= --------------------------
[text]incomingString=3Dabcdefghijklmnopqrstu= vwxyz~!@#$%^&*()_+`-=3D{}|[]\:";'<>?,./ 
1234567890ABCDE= FGHIJKLMNOPQRSTUVWXYZ[/text]

[text]cleanedString=3D[grep = search=3D[URL][^a-zA-Z0-9_+-][/URL]&replace=3D][incomingString][/grep]= [/text]

incomingString=3D[incomingString]<br/>
cleanedStri= ng=3D[cleanedString]<br/>
---------------------------------------= -------------------------------------------------

It seems in = webdna's grep.. that the "+" char can go anywhere that makes sense = *except* at the end of the Character Class  (which causes the whole = script to fail)  (reason??).

Also if I did not wrap the = search string with [URL], then that also failed in the sense that the + = was not treated as a literal "+".
(Lucky us in this case we did not = need the "+"  to behave as a quantifier char, which may have opened = up another can of = worms.)

-G

--------------------------= --------------------------------------------------------------------------= ------------
---------------------------------------------------= -------------------------------------------------------------
= --Apple-Mail-41--1002622787-- Associated Messages, from the most recent to the oldest:

    
--Apple-Mail-41--1002622787 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > I found this from an old note: >=20 > It seems in webdna's grep.. that the "+" char can go anywhere that = makes sense *except* at the end of the Character Class (which causes the = whole script to fail) (reason??). from here: = --------------------------------------------------------------------------= -------------------------------------- = --------------------------------------------------------------------------= -------------------------------------- From: Govinda Subject: Re: [WebDNA] GREP problem Date: 2011-04-21 11:53:44 AM EDT To: WebDNA talk Hi Stuart I got this to work for you: = --------------------------------------------------------------------------= -------------- = [text]incomingString=3Dabcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+`-=3D{}|[]\:= ";'<>?,./=20 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[/text] [text]cleanedString=3D[grep = search=3D[url][^a-zA-Z0-9_+-][/URL]&replace=3D][incomingString][/grep][/te= xt] incomingString=3D[incomingString]
cleanedString=3D[cleanedString]
= --------------------------------------------------------------------------= -------------- It seems in webdna's grep.. that the "+" char can go anywhere that makes = sense *except* at the end of the Character Class (which causes the = whole script to fail) (reason??). Also if I did not wrap the search string with [url], then that also = failed in the sense that the + was not treated as a literal "+". (Lucky us in this case we did not need the "+" to behave as a = quantifier char, which may have opened up another can of worms.) -G = --------------------------------------------------------------------------= -------------------------------------- = --------------------------------------------------------------------------= -------------------------------------- --Apple-Mail-41--1002622787 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

I found this from an old = note:

It seems in webdna's grep.. that the "+" char can = go anywhere that makes sense *except* at the end of the Character Class = (which causes the whole script to fail) = (reason??).

from = here:

-------------------------------------------= ---------------------------------------------------------------------
--------------------------------------------------------------------= --------------------------------------------

= From: = Govinda   <govinda.webdnatalk@gmail.com<= /a>>

Hi Stuart

I got this to work = for = you:

--------------------------------------------------------------= --------------------------
[text]incomingString=3Dabcdefghijklmnopqrstu= vwxyz~!@#$%^&*()_+`-=3D{}|[]\:";'<>?,./ 
1234567890ABCDE= FGHIJKLMNOPQRSTUVWXYZ[/text]

[text]cleanedString=3D[grep = search=3D[url][^a-zA-Z0-9_+-][/URL]&replace=3D][incomingString][/grep]= [/text]

incomingString=3D[incomingString]<br/>
cleanedStri= ng=3D[cleanedString]<br/>
---------------------------------------= -------------------------------------------------

It seems in = webdna's grep.. that the "+" char can go anywhere that makes sense = *except* at the end of the Character Class  (which causes the whole = script to fail)  (reason??).

Also if I did not wrap the = search string with [url], then that also failed in the sense that the + = was not treated as a literal "+".
(Lucky us in this case we did not = need the "+"  to behave as a quantifier char, which may have opened = up another can of = worms.)

-G

--------------------------= --------------------------------------------------------------------------= ------------
---------------------------------------------------= -------------------------------------------------------------
= --Apple-Mail-41--1002622787-- Govinda

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:

Sample Tearoom Search Error - Solved! (1997) RE: [WebDNA] directory protection questions (2008) HELP WITH DATES (1997) Web Catalog 2 demo (1997) Redirect frame targets (1998) Max Record length restated as maybe bug (1997) billing system (2003) WC on Mac OS X or Mac OS X Server 2.x (2001) [OT] Disable/enable field (2003) Emailer (2002) WSDL Wizard (2003) WebCat2 - [format thousands] (1997) sort problems....bug or brain fart? (1997) WebDelivery downloads alias, not original ? (1997) Multiple Passwords (1997) Date comparison (I think) has bugs ... (1998) writing db to disk (1997) Whats wrong with this code? (1998) Almost a there but..bye bye NetCloak (1997) login via cookies (2006)