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 = 109023
interpreted = N
texte = --Apple-Mail=_1480FC8C-1FC6-4E9A-828E-12397C575079 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Well spotted :) On 02/05/2012, at 2:52 PM, Govinda wrote: >=20 >> 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??). >=20 > from here: >=20 > = --------------------------------------------------------------------------= -------------------------------------- > = --------------------------------------------------------------------------= -------------------------------------- >=20 > From: Govinda > Subject: Re: [WebDNA] GREP problem > Date: 2011-04-21 11:53:44 AM EDT > To: WebDNA talk >=20 > Hi Stuart >=20 > I got this to work for you: >=20 > = --------------------------------------------------------------------------= -------------- > = [text]incomingString=3Dabcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+`-=3D{}|[]\:= ";'<>?,./=20 > 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[/text] >=20 > [text]cleanedString=3D[grep = search=3D[URL][^a-zA-Z0-9_+-][/URL]&replace=3D][incomingString][/grep][/te= xt] >=20 > incomingString=3D[incomingString]
> cleanedString=3D[cleanedString]
> = --------------------------------------------------------------------------= -------------- >=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??). >=20 > 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.) >=20 > -G >=20 > = --------------------------------------------------------------------------= -------------------------------------- > = --------------------------------------------------------------------------= -------------------------------------- >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_1480FC8C-1FC6-4E9A-828E-12397C575079 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Well = spotted :)



On = 02/05/2012, at 2:52 PM, Govinda wrote:


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

--------------------------= --------------------------------------------------------------------------= ------------
---------------------------------------------------= -------------------------------------------------------------
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_1480FC8C-1FC6-4E9A-828E-12397C575079-- Associated Messages, from the most recent to the oldest:

    
--Apple-Mail=_1480FC8C-1FC6-4E9A-828E-12397C575079 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Well spotted :) On 02/05/2012, at 2:52 PM, Govinda wrote: >=20 >> 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??). >=20 > from here: >=20 > = --------------------------------------------------------------------------= -------------------------------------- > = --------------------------------------------------------------------------= -------------------------------------- >=20 > From: Govinda > Subject: Re: [WebDNA] GREP problem > Date: 2011-04-21 11:53:44 AM EDT > To: WebDNA talk >=20 > Hi Stuart >=20 > I got this to work for you: >=20 > = --------------------------------------------------------------------------= -------------- > = [text]incomingString=3Dabcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+`-=3D{}|[]\:= ";'<>?,./=20 > 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[/text] >=20 > [text]cleanedString=3D[grep = search=3D[url][^a-zA-Z0-9_+-][/URL]&replace=3D][incomingString][/grep][/te= xt] >=20 > incomingString=3D[incomingString]
> cleanedString=3D[cleanedString]
> = --------------------------------------------------------------------------= -------------- >=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??). >=20 > 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.) >=20 > -G >=20 > = --------------------------------------------------------------------------= -------------------------------------- > = --------------------------------------------------------------------------= -------------------------------------- >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_1480FC8C-1FC6-4E9A-828E-12397C575079 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Well = spotted :)



On = 02/05/2012, at 2:52 PM, Govinda wrote:


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

--------------------------= --------------------------------------------------------------------------= ------------
---------------------------------------------------= -------------------------------------------------------------
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_1480FC8C-1FC6-4E9A-828E-12397C575079-- Stuart Tremain

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:

WebCat b13 CGI -shownext- (1997) [WebDNA] WebDNA future (2010) replace using &append=T (2007) Replace Statement (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) How true is this? (1999) Caching [include] files ... (1997) Some Advise needed (1997) OT: Where to turn (2003) requiring form fields? (2000) WC2b15 File Corruption (1997) ShowIf variables (1997) [OT] DOD again (2003) Page Counters? (1997) Re:2nd WebCatalog2 Feature Request (1996) Softball questions (2003) webcat- multiple selection in input field (1997) policies, slightly OT (2004) Online reference (1997) [Shell] question (2000)