Does regex replace support if condition find and replace

How to find and replace text where if in my FIND regex $1 group had matches then REPLACE regex match to $2 else $3

eg:

FIND
(a?)(\w)(\w)
OCCURRENCE
abc
REPLACE
{mine unknown that I am looking for} something like
if($1.matches.length>1) return $2; else return $3;
EFFECT
b

0

Please sign in to leave a comment.