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:

system crashes, event log (1997) serial number not working (1998) [WebDNA] sudo and shell (2010) interesting (2003) [WebDNA] Group results but continuous (2016) Two stores, one server (1998) Bugs in IE 6.0 ? (2003) WebCat2b13MacPlugin - [math][date][/math] problem (1997) Variables (1999) Migrating to NT (1997) Location of Browser Info.txt file (1997) Signal Raised Error (1997) Width & Height (1998) Cart Question (1998) quick GREP question (2001) b12 cannot limit records returned and more. (1997) Version f1 status (1997) lineitems are gone (1998) Re:quit command on NT (1997) Nested tags count question (1997)