Help With Regular Expression Requested

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Corey

    #1

    Help With Regular Expression Requested

    Dear All,

    I must admit I'm very new to regular expressions. I'm trying to identify
    strings that have well formed URL's in them. I'm currently using the
    following expression:

    (?<Protocol>\w+ ):\/\/(?<Domain>[\w.]+\/?)\S*

    It identifies URL's like http://www.google.com and
    http://www.usq.edu.au/library/ as correct which is what I want.
    Unfortunately it also matches against URL's that are like
    http://www/google/com which is obviously not good. The reason we have these
    URL's is that I'm doing consistency checks on a database and in the past
    some URL's have become corrupted.

    Many thanks for any assistance you can provide.

    With thanks.

    -Corey


Working...