Robert:
(<a href=")[^"]+(") seems to work when I replaced the " with <@DQ> to
satisfy the <@REGEX EXPR="">
But, it only finds the first URL and not the second URL within the
same text block.
Any idea?
Thanks!
MC
At 07:38 PM 8/13/2007, you wrote:
I don't have a working copy of witango studio up at the moment. But I
always first test this stuff in bbedit, or some other text editor
that uses regular expressions. So this may help you, you just have to
translate it to witango regex.
To find the URL, I would use this:
(<a href=")[^"]+(")
This basically says, find all that is NOT a quote in between <a
href=" and "
Now the parenthesis are to specify subpatterns. So I can reuse the
subpatterns in my replacement string. My replacement string looks
like this:
\1somenewurl\2
This tells regex to to replace the entire matched string above with
the first subpattern, then some new text, then the 2nd subpattern.
The first subpattern is <a href=" and the second is just the last
quote. So the new string becomes:
<a href="somenewurl"
The above only works if all your hrefs are quoted, and double quoted,
otherwise you would have to do a much more sophisticated search pattern.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On Aug 13, 2007, at 5:32 PM, MC Tay wrote:
Robert:
Can REGEX find multiple matching occurrences at one time, or only
find the first match within the text block?
I tried using <@regex expr="(a[[:space:]]href=<@DQ>https?://)(.*)
([\<\/]a[\>])" str="<@COLUMN 'MYTABLE.TEXTBLOCK'>" type=E>
and it matched the beginning of the first URL to the end of the
second URL. How do I make it stop at the end of the first URL?
Thanks!
MC
At 08:55 AM 8/13/2007, you wrote:
That is exactly what REGEX is designed to do. It has a learning
curve, but you should seriously dive in, its a great tool to have
under your belt.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On Aug 13, 2007, at 1:35 AM, MC Tay wrote:
Hi:
I'm trying to figure out how to replace one or more URLs within a
block of text so that I can insert it with a click through
URL........and I need some help.
Here's a sample of the block of text:
This is the block of text.....bluh bluh bluh........ <a
href="http://www.websiteone.com/app1.taf?
>>> para1=100¶2=200¶3=300" target="_blank"> ....and the text
continues....
.....bluh bluh bluh...... <a href="http://www.websitetwo.com/
>>> app2.taf?p1=aaa&p2=bbb"> and more text ........
I want to replace the URLs within the text as follows, but not sure
how to do that. Any help is much appreciated.
<a href="http://www.websiteone.com/app1.taf?
>>> para1=100¶2=200¶3=300" target="_blank">
becomes
<a href="http://www.mywebsite.com/click.taf?vurl=http://
>>> www.websiteone.com/app1.taf?para1=100¶2=200¶3=300"
target="_blank">
<a href="http://www.websitetwo.com/app2.taf?p1=aaa&p2=bbb">
becomes
<a href="http://www.mywebsite.com/click.taf?vurl=http://
>>> www.websitetwo.com/app2.taf?p1=aaa&p2=bbb">
Thanks
MC
____________________________________________________________________ __ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
_____________________________________________________________________ ___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf