Title: RE: Witango-Talk: Auto a href
Tried this...

<@assign str "<@arg text>" SCOPE="user">
<@assign expr "https?://[^ ]+\.[a-zA-Z]{2,4}" SCOPE="user">
<@regex str="@@str" expr="expr" type="e">

Still getting M

I really have no idea what I am doing. I have never worked with regex before. I can see where this would identify the actual URL string, but I am unsure as to how to rewrite the file to add the <a href="" and the appending " target=_blank"> and then the actual text of the link and to wind up with </a> at the end.

I started trying to use <@replace> and other various metatags associated with string variables, now I have not a clue.

Anyway, maybe I need to do a bit of reading and experimenting before I go on...

Ok try this
 
[ ]https?://[^ ]+\.[a-zA-Z]{2,4}[ ]
 
This says
1.      starts with [space]http
2.      has 1 to many non spaces chars
3.      ends with . and 2 to 4 chars with space after that
 
Ben Johansen - http://www.pcforge.com
Authorized Witango & MDaemon Reseller
Available for Web App. Developement


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 18, 2005 9:52 AM
To: witango-talk@witango.com
Subject: Re: Witango-Talk: Auto a href

 
Okay, I am not a regex expert by any means, but I am trying to do something like this,
 
<@assign str "<@arg text>" SCOPE="user">
<@assign expr "http?://[^ ]*" SCOPE="user">
<@regex str="@@str" expr="expr" type="e">

 
but I keep getting a return of M regardless if I am typing anything with http:// in it or not.
 
I think this is on the right track, just wondering where to go from here...
 
Thanks!
 
On a more useful note that my previous:
 
<@assign request$str "visit http://www.google.com/modules/default.taf now">
<@assign request$expr "http?://[^ ]*">
<@regex str="@@request$str" expr="@@request$expr" type="e">
 
will return
 
http://www.google.com/modules/default.taf
 
Since the _expression_ is looking for the first space to terminate the url, it will include any punctuation (think url at end of sentence, the full stop will be included) and if the url spans multiple lines, the line returns will also be included.
 
J.
 
 
On 16/02/2005, at 11:39 PM, [EMAIL PROTECTED] wrote:


The challenge is to find the string that represents an URL, which begins
with http:// and ends with the first space after that.
 
WITH IMAGINATION
Planning, Implementation and Management of Web Applications
 
160 Pacific Highway North Sydney NSW Australia 2060
phone + 612 9929 9229 fax + 612 9460 4770 
web - www.wi.com.au email -  [EMAIL PROTECTED]
 

________________________________________________________________________
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

Reply via email to