bairava surya wrote:The about code matches "101 surya" but it does not match "101 C".I used + to match one or character and ? to match single letter or group please justify?
bairava surya wrote:As the purpose of the carat operator(^) is to perform negation.
^(1[0-2]|[1-9])$
(1[0-2]|[1-9])$
both the above pattern will accept numbers between 1-12 and please explain me the difference?
bairava surya wrote:As the purpose of the carat operator(^) is to perform negation
bairava surya wrote:https://www.hackerrank.com/challenges/hackerrank-language
i just wrote the pattern to solve above problem.
bairava surya wrote:Pattern p=Pattern.compile("([0-9][0-9][0-9][0-9][0-9]0?) (C|CPP|JAVA|PYTHON|DELETED)");
sorry is it correct?
bairava surya wrote:
please help me the exception in the above pattern i.e occured due to brackets.
Stephan van Hulst wrote:
Protip: Stop using regular expressions to do verification of numbers.