Try our conversational search powered by Generative AI!

Set Textbox field with regex pattern to disallow URL's (http/www)

Vote:
 

I'm looking for a regex pattern that allows only alphanumeric and disallows URL's with ignore case option that could have http,https and www in name textbox fields. 

Much appreciated for any quick help on this. 

#267366
Nov 25, 2021 8:28
Vote:
 

If you want to explicit dissallow http/https/www you can use this (it's not ignore case):

^((?!www|http)[a-z0-9\-_ ])*$

But, you can't write an URL without the `://` part,  can you? So maybe this will do, it will ignore case and only allow "word characters" and whitespace

^(\w?\s?)*$
#267371
Nov 25, 2021 11:34
Vote:
 

Thanks Tomas Hensrud Gulla for your response. 

#268186
Dec 10, 2021 10:10
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.