Hi All,
I have wriittn below regex for two lines.
String LN1Pattern = "^((?=.{1,35}$)(/([A-Z]{1,5})(|(//[a-zA-Z0-9]+))))$"; System.out.println("/ABC//FGhiJkl012345".matches(LN1Pattern)); String LN2Pattern = "^(|((\\s+(//[a-zA-Z0-9]{1,33})){1,2}))$"; System.out.println("".matches(LN2Pattern));
\\s+ is a newline character.
But when I combines both as below, its not giving me expected result.
^(((?=.{1,35}$)(/([A-Z]{1,5})(|(//[a-zA-Z0-9]+))))(|((\\s+(//[a-zA-Z0-9]{1,33})){1,2})))$
For string "/ABC//FGhiJkl012345\n//abCD01EF02" - returns False. Expected is True
I think there is some problem in lookahead placed.
Please help.
Thanks
Raj