Does anyone know anything about Regex?

by Rubik
3 replies
I want to retrieve a URL between two strings on a webpage. For example: "url":"http://google.com"}

I tried this, but it doesn't seem to be working.
Code:
var regex = new Regex(@"""url"":""([0-9_a-z/:.]*)""}""", RegexOptions.IgnoreCase);
#regex
  • Profile picture of the author Artur Golisz
    Using PERL notation:

    Code:
    #"url":"[a-zA-Z0-9:\/\.\-\_]+"#
    Signature
    Need help with programming (WordPress, PHP, jQuery and more) ? Just send me PM.
    {{ DiscussionBoard.errors[8442521].message }}
  • Profile picture of the author David Beroff
    Rather than parsing what characters can be in a URL, wouldn't it be easier to simply say "everything that's not a quote mark" in between the two quote marks?
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[8442712].message }}
  • Profile picture of the author Rubik
    I actually got it working, but thank you guys anyway!
    {{ DiscussionBoard.errors[8444578].message }}

Trending Topics