Reputation: 367
Can you help me to find Regex expression to validate invalid characters in a url string? Everything I found in the internet is having http/https
validations. That shouldn't be the case. I need just a url string to validate invalid url characters(such as $,},{,-,etc..
)
Upvotes: 1
Views: 631
Reputation: 133
this works fine for me:
[^\w\.@-\\]
if you want to allow character simply add these into the regex...for example if you want to allow "%" become:
[^\w\.@-\\%]
Upvotes: 2
Reputation: 54
(\b(https?|ftp|file)://)?[-A-Za-z0-9+&@#/%?=~|!:,.;]+[-A-Za-z0-9+&@#/%=~|]
Upvotes: 0