Title: Re: Witango-Talk: Auto a href

Ok,

To use the ? (optional) operator you need to have the optional value

 

Try

https?://[^ ]*

 

notice the “s?” this says that the s is optional

 

a good test site is

http://www.quanetic.com/regex.php

 

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: [email protected]
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

Reply via email to