Page 1 of 1

Finding a Unicode URL

Posted: Sat Oct 20, 2018 8:18 am
by Debugger
Please improve this regex to detect the unicode link:

http(news|http|ftp|https):\/\/[\w\-_]+(\.[\w]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

Re: Finding a Unicode URL

Posted: Sat Oct 20, 2018 9:11 am
by void
Please try searching for:

(news|http|ftp|https):\/\/.*[^\x00-\x7f]

(news|http|ftp|https) = match news, http, ftp or https
: = match a literal :
\/ = match a literal /
.* = match any character, any number of times
[^\x00-\x7f] = match a non-ASCII character.

Re: Finding a Unicode URL

Posted: Sat Oct 20, 2018 9:39 am
by Debugger
Thanks, it works, but I want to search in both cases(in all matches), Unicode and without Unicode.