I have a string that could be of this kind, for example :
String text = 'test AZ123AZ testtesttest';
I need to retrive this part of the string :
AZ123AZ
So for now I have something like this in my apex code :
String regexTest ='[A-Z]{2}[0-9]{3}[A-Z]{2}';
Matcher matcher =Pattern.compile(regexTest ).matcher(text);
Boolean result = matcher.find();
The boolean result gives me true if the regex type is in a string so it's ok, but I need to retrive the value of the regex to put it into another string (only this part of the string text
is important for me)