|
-
Jun 21st, 2007, 12:57 PM
#1
Thread Starter
New Member
[2005] Help with regular expression pattern
Hi, I am trying to modify a regular expression so that it will properly convert text that resembles a hyperlink into the actual HTML code (a href). I have a slight problem with the pattern that I am using. It doesn't capture any parameters on the end of the URL if it has any. For instance, it captures http://www.somewebsite.com/ just fine, but it doesn't capture http://www.somewebsite.com/test.aspx...=1&otherparm=2 properly. It doesn't catch everything from the ? over. Here is the code:
Dim patternSite As String = "\w*[\://]*\w+\.\w+\.\w+[/\w+]*[.\w+]*"
Thanks!
-
Jun 21st, 2007, 04:36 PM
#2
Re: [2005] Help with regular expression pattern
"\w*[:/]*[\w.-]+\.\w{2,4}[/.\w=&]*"
-
Jun 21st, 2007, 04:45 PM
#3
Re: [2005] Help with regular expression pattern
just as an fyi - I can usualy find anything I need via here: http://regexlib.com/default.aspx searchable, easy to use, and there's usually a dozen different ways to do the same thing.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|