Naming a Capture

ericliu
1 min readOct 17, 2019
Replace an Optional with non-Optional
Optional<(?<foo>.*)>

Captures Optional variables and name the captured variable foo .

Then we can replace the Optional with non-Optional by using the named capture:

${foo}

Capture comments.

/\*\*(?<foo>.+)\*/

References

http://regexrenamer.sourceforge.net/help/regex_quickref.html

--

--