I have to extract a link out of a String !

Comments

2 comments

  • Alan Mark

    Hi Valentin,

    Here's the regex string:

    (http|https):\/\/.*[\S]\.[\S]*

    I tested this with:

    test test test https://www.google.com/test/test test test test

    and

    test test test http://www.google.com/test/test test test test

    I developed this regex using the Regex101 site.  It's really useful for debugging regexes!

    1
    Comment actions Permalink
  • Valentin Mühle

    Thanks, worked for me.

    0
    Comment actions Permalink

Please sign in to leave a comment.