I have a simple regex pattern which I'm using to validate a string.
I want to use the same regex in order to produce a string, using the exact same regex.
For example, I have the following regex: const regex = ^action:(?<whatAction>(WRITE|READ|DELETE))$
Is there any function substitute
so: substitute(regex, {whatAction: "WRITE"})
will yield action:WRITE
?
Thanks in advance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…