Results 1 to 3 of 3

Thread: [2005] Help with regular expression pattern

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    1

    [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!

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: [2005] Help with regular expression pattern

    "\w*[:/]*[\w.-]+\.\w{2,4}[/.\w=&]*"

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width