Example: Dear sir, No. Employee is (PM/23333999) 10) i want thank you.(MA/IERPER) i want resigned.
Hi sir,
regex : \d{1,2}+(?:(\)))
result: 10) and 99) and )
What is regex pattern can i using to get result only '10)' from split the string?
Your pattern is equal to \d{1,2}+\), i.e. your pattern consumes and returns ).
You may use
\d{1,2}(?=\))
where (?=\)) is a positive lookahead that will require the presence of ) but won't return it in the match. Also, note that {1,2}+ here will behave the same as a non-possessive, greedy {1,2} quantifier (as there are no other ways to match the string before )), so no need adding the +.
See the regex demo.
In Java, declare it as
String regex = "\\d{1,2}(?=\\))";
since you are saying to match only 10) try the following
\d{1,2}+\)(?!.*\d{1,2}+\))
\d{1,2}+\). Try\d{1,2}(?=\))