How to specify to match more than one character inside regex sqaure brackets? -


given user input string, need find if end 1 of following - .com, .net , .edu., html etc.

is there way regex square brackets?

i tried $[.com|.net|.html] , $[(.com)(.net)(.html)] both don't work.

you want use capture group.

(\.com|\.net|\.html) 

this match either 1 of values. can add additional values appending pipe inside parenthesis , placing new value after pipe.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -