Reputation: 20156
There is a regex for URL but it does not support unicode characters.
^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?
I want to use it in both javascript and C#
Upvotes: 1
Views: 2181
Reputation: 91385
Replace every occurrences of a-zA-Z
by \pL
.
Thanks to @Lesley:
Unicode properties are not available in javascript, we have to use a package like regexp.
Upvotes: 2
Reputation: 12610
As you are using Unicode characters I think that you want to get non english language (like Arabic, hebrew or persian....) so just chage the are from a-z
A-Z
to ا-ی
or other equivalents
Upvotes: 0