Is it possible to copy the value of a group into another one within the regex? Means, I have a text line
errID name_of_error: description bla bla
and I use this RE to save all parts of this line
^(?'code'[\w\d]{5}) {3}(?'name'[\w\d]+?(?=:)): (?<= )(?'desc'.+?)(?=$)
What I would have is an additional group in my regex containing the value of ‘code’, like
code -> errID
newgroup-> errID
name-> name_of_error
desc -> description bla bla
Is it feasible?
EDIT: I’m using C#
I don’t know what language you are using, especially for the syntax of the named groups but I think you can use :
Moreover
[\w\d]can be simplified to\wthen the regex becomes: