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
Post a Comment