• Senthil 1
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
Hi,
 I have the following code in my controller.
----------------------------------------------------
 Pattern findMethodPattern = Pattern.compile('/\bSREV_[a-zA-Z0-9]+Handler[.]([a-zA-Z0-9]+)(?=)/gi');
 string str = 'SREV_TaskHandler.TaskBeforeUpdate(Trigger.new , Trigger.old);';
 Matcher tgrBodyMatter = findMethodPattern.matcher(str);
 system.debug('>>>'+ tgrBodyMatter.matches());//is always false.
----------------------------------------------------
 From the above code, the tgrBodyMatter.matches() should return true and with a value "TaskBeforeUpdate" but it is always false. if I use the same input and expression is working fine on https://regex101.com/r/oJ8xL2/1
Please guide.

 
Hi,
 I have the following code in my controller.
----------------------------------------------------
 Pattern findMethodPattern = Pattern.compile('/\bSREV_[a-zA-Z0-9]+Handler[.]([a-zA-Z0-9]+)(?=)/gi');
 string str = 'SREV_TaskHandler.TaskBeforeUpdate(Trigger.new , Trigger.old);';
 Matcher tgrBodyMatter = findMethodPattern.matcher(str);
 system.debug('>>>'+ tgrBodyMatter.matches());//is always false.
----------------------------------------------------
 From the above code, the tgrBodyMatter.matches() should return true and with a value "TaskBeforeUpdate" but it is always false. if I use the same input and expression is working fine on https://regex101.com/r/oJ8xL2/1
Please guide.