Re: [WebDNA] Using Grep to pull links from a variable

This WebDNA talk-list message is from

2014


It keeps the original formatting.
numero = 111370
interpreted = N
texte = > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3482920379_90407636 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit That's the first thing I tried as well but it has the same result. I'm pretty sure I got the code from the old talklist years ago but it works fine when in the middle of a paragraph, so I haven't noticed it was broken until recently. From: William DeVaul Reply-To: Date: Wednesday, May 14, 2014 1:37 PM To: "talk@webdna.us" Subject: Re: [WebDNA] Using Grep to pull links from a variable Here's my attempt: [grep search=http://([^ %0A]*)&replace=\1][convertchars][story][/convertchars][/grep] OK, I'm pretty sure your inner grep does nothing. It finds something and then puts it back in place. In some regex, there's a "blank" designation but I'm not sure WebDNA has that so I'd use space and %0A. Bill On Wed, May 14, 2014 at 1:51 PM, Eddie Z wrote: > I've been using this code for years but have found some issues with it and > don't understand Grep well enough to figure out how to fix it. > > [grep search=http://([^ ]*)&replace=\1][grep > search=http://([^%0A]*)&replace=http://\1 > ][convertchars][story][/convertchars][/grep][/grep] > > Here's an example of the data in the variable [story]: > June 21st > USAV JBT Central Open Qualifier #2 > Bradford Beach, Milwaukee > Register Here - http://tinyurl.com/mjhgzx6/ > Register for Club - http://tinyurl.com/od8bmso/ > > > I understand that the first Grep is searching for the http:// and a trailing > space, but in the example above there is no trailing space because the link is > at the end of the line and followed by a return. I assumed that's what the > second grep was looking for, but this is what the resulting link is: > tinyurl.com/ mjhgzx6 > /
Register
for Club > > The only workaround I've found it to go in and enter a space after the links. > I'm sure it's probably an easy fix to someone that knows how to use Grep. > > Off topic: Could Grep be used to format phone numbers as 999-999-9999, or are > there too many different ways for people to enter them into a text field. > Common entries would be 9999999999, 999.999.9999, 1-999-999-9999, (999) > 999-9999, et. I realize I could redo my forms to make them enter area code, > prefix and line number separately, but I'm hoping for an easier method. > > Thanks, > Eddie Zelhofer > Thinksite, LLC > 920-420-2066 > http://www.thinksite.com > --------------------------------------------------------- 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 --------------------------------------------------------- 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 --B_3482920379_90407636 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable
That's the first thing I tri= ed as well but it has the same result. I'm pretty sure I got the code from t= he old talklist years ago but it works fine when in the middle of a paragrap= h, so I haven't noticed it was broken until recently.

From: William DeVaul <wdevaul@gmail.com>
Reply-To: <talk@webdna.us&g= t;
Date: Wednesday, May 14, 2014 1= :37 PM
To: "talk@webdna.us" <talk@webdn= a.us>
Subject: Re: [WebDNA]= Using Grep to pull links from a variable

Here's my attempt:

[grep search=3Dhttp://([^ %0A]*)&replace=3D<a h= ref=3D"http://\1">\1</a>][convertchars][story][/convertchars= ][/grep]

OK, I'm pretty sure your inner grep do= es nothing. It finds something and then puts it back in place.  
<= div>
In some regex, there's a "blank" designation but I'm not = sure WebDNA has that so I'd use space and %0A. 

Bill


= On Wed, May 14, 2014 at 1:51 PM, Eddie Z <eddie@thinksite.com> wro= te:
I've been using t= his code for years but have found some issues with it and don't understand G= rep well enough to figure out how to fix it.

[= grep search=3Dhttp://([^ ]*)&replace=3D<a href=3D"= http://\1">\1</a>][= grep search=3Dhttp://([^%= 0A]*)&replace=3Dhttp://\1 ][convertchars][story][/convertchars][/grep]= [/grep]

Here's an example of the data in the = variable [story]:
June 21st
USAV JBT Central Open Qualifier #2<= br>Bradford Beach, Milwaukee
Register Here - http://tinyurl.com/mjhgzx6/
Regi= ster for Club - ht= tp://tinyurl.com/od8bmso/
 
I understand that the= first Grep is searching for the http:// and a trailing space, but in the ex= ample above there is no trailing space because the link is at the end of the= line and followed by a return. I assumed that's what the second grep was lo= oking for, but this is what the resulting link is:
<= ;a href=3D"http://tinyurl.com/mjhgzx6/<br>Register">tin= yurl.com/mjh= gzx6/<br>Register</a> for Club
=
The only workaround I've found it to go in and e= nter a space after the links. I'm sure it's probably an easy fix to someone = that knows how to use Grep.

Off topic: Could Grep be used to format phone numbers as 999-999-9999, or= are there too many different ways for people to enter them into a text fiel= d. Common entries would be 9999999999, 999.999.9999, 1-999-999-9999, (999) 9= 99-9999, et. I realize I could redo my forms to make them enter area code, p= refix and line number separately, but I'm hoping for an easier method.

Thanks,
Eddie Zelhofer<= br>Thinksite, LLC
920-420-2066
http://www.thinksite.com
--------------------------------------------------------- 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@w= ebdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.w= ebdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --B_3482920379_90407636-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Using Grep to pull links from a variable (Eddie Z 2014)
  2. Re: [WebDNA] Using Grep to pull links from a variable (William DeVaul 2014)
  3. [WebDNA] Using Grep to pull links from a variable (Eddie Z 2014)
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3482920379_90407636 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit That's the first thing I tried as well but it has the same result. I'm pretty sure I got the code from the old talklist years ago but it works fine when in the middle of a paragraph, so I haven't noticed it was broken until recently. From: William DeVaul Reply-To: Date: Wednesday, May 14, 2014 1:37 PM To: "talk@webdna.us" Subject: Re: [WebDNA] Using Grep to pull links from a variable Here's my attempt: [grep search=http://([^ %0A]*)&replace=\1][convertchars][story][/convertchars][/grep] OK, I'm pretty sure your inner grep does nothing. It finds something and then puts it back in place. In some regex, there's a "blank" designation but I'm not sure WebDNA has that so I'd use space and %0A. Bill On Wed, May 14, 2014 at 1:51 PM, Eddie Z wrote: > I've been using this code for years but have found some issues with it and > don't understand Grep well enough to figure out how to fix it. > > [grep search=http://([^ ]*)&replace=\1][grep > search=http://([^%0A]*)&replace=http://\1 > ][convertchars][story][/convertchars][/grep][/grep] > > Here's an example of the data in the variable [story]: > June 21st > USAV JBT Central Open Qualifier #2 > Bradford Beach, Milwaukee > Register Here - http://tinyurl.com/mjhgzx6/ > Register for Club - http://tinyurl.com/od8bmso/ > > > I understand that the first Grep is searching for the http:// and a trailing > space, but in the example above there is no trailing space because the link is > at the end of the line and followed by a return. I assumed that's what the > second grep was looking for, but this is what the resulting link is: > tinyurl.com/ mjhgzx6 > /
Register
for Club > > The only workaround I've found it to go in and enter a space after the links. > I'm sure it's probably an easy fix to someone that knows how to use Grep. > > Off topic: Could Grep be used to format phone numbers as 999-999-9999, or are > there too many different ways for people to enter them into a text field. > Common entries would be 9999999999, 999.999.9999, 1-999-999-9999, (999) > 999-9999, et. I realize I could redo my forms to make them enter area code, > prefix and line number separately, but I'm hoping for an easier method. > > Thanks, > Eddie Zelhofer > Thinksite, LLC > 920-420-2066 > http://www.thinksite.com > --------------------------------------------------------- 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 --------------------------------------------------------- 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 --B_3482920379_90407636 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable
That's the first thing I tri= ed as well but it has the same result. I'm pretty sure I got the code from t= he old talklist years ago but it works fine when in the middle of a paragrap= h, so I haven't noticed it was broken until recently.

From: William DeVaul <wdevaul@gmail.com>
Reply-To: <talk@webdna.us&g= t;
Date: Wednesday, May 14, 2014 1= :37 PM
To: "talk@webdna.us" <talk@webdn= a.us>
Subject: Re: [WebDNA]= Using Grep to pull links from a variable

Here's my attempt:

[grep search=3Dhttp://([^ %0A]*)&replace=3D<a h= ref=3D"[convertchars][story][/convert= chars][/grep">http://\1">\1</a>][convertchars][story][/convertchars= ][/grep]

OK, I'm pretty sure your inner grep do= es nothing. It finds something and then puts it back in place.  
<= div>
In some regex, there's a "blank" designation but I'm not = sure WebDNA has that so I'd use space and %0A. 

Bill


= On Wed, May 14, 2014 at 1:51 PM, Eddie Z <eddie@thinksite.com> wro= te:
I've been using t= his code for years but have found some issues with it and don't understand G= rep well enough to figure out how to fix it.

[= grep search=3Dhttp://([^ ]*)&replace=3D<a href=3D"= http://\1">\1</a>][= grep search=3Dhttp://([^%= 0A]*)&replace=3Dhttp://\1 ][convertchars][story][/convertchars][/grep]= [/grep]

Here's an example of the data in the = variable [story]:
June 21st
USAV JBT Central Open Qualifier #2<= br>Bradford Beach, Milwaukee
Register Here - http://tinyurl.com/mjhgzx6/
Regi= ster for Club - ht= tp://tinyurl.com/od8bmso/
 
I understand that the= first Grep is searching for the http:// and a trailing space, but in the ex= ample above there is no trailing space because the link is at the end of the= line and followed by a return. I assumed that's what the second grep was lo= oking for, but this is what the resulting link is:
<= ;a href=3D"http://tinyurl.com/mjhgzx6/<br>Register">tin= yurl.com/mjh= gzx6/<br>Register</a> for Club
=
The only workaround I've found it to go in and e= nter a space after the links. I'm sure it's probably an easy fix to someone = that knows how to use Grep.

Off topic: Could Grep be used to format phone numbers as 999-999-9999, or= are there too many different ways for people to enter them into a text fiel= d. Common entries would be 9999999999, 999.999.9999, 1-999-999-9999, (999) 9= 99-9999, et. I realize I could redo my forms to make them enter area code, p= refix and line number separately, but I'm hoping for an easier method.

Thanks,
Eddie Zelhofer<= br>Thinksite, LLC
920-420-2066
http://www.thinksite.com
--------------------------------------------------------- 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@w= ebdna.us

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

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:

problems with 2 tags (1997) Exclamation point (1997) Webcat causing crashes left and right! (1997) Problems passing [SKU] with $Replace in 2.0 (1997) Need Sample Template - just purchased (1997) Bug Report, maybe (1997) Summing fields (1997) Location of Browser Info.txt file (1997) NTbeta18 corrupted? (1997) Authorize.net SIM/AIM deadline extended (2003) Help with Repost Data msg from form (1997) is 'template' a reserved webcat tag? (2000) Adding order weight (1999) off topic - dna snipets (1997) [WebDNA] Rewrite url (2013) WebDNA vs PHP (2003) WebCatalog for Postcards ? (1997) hm. (2002) WCS Newbie question (1997) Paths (1998)