get the group expression portion of a matching expression [not a duplicate, please read carefully] : this is a repost [get the group expression portion of a matching expression][1], which was erroneously, but undestandingly marked as duplicate. what i am trying to obtain is the portion of the regular expression, not the portion of the matching string.

contents of previous post:

given the var `expression = /(a.)|(b.)|(c.)/;`, to match the `var value = "axx"`, i would like to be able to get the portion of `expression` that matched the `value`, in this case, `(a.)`


  [1]: http://stackoverflow.com/questions/36574566/get-the-group-expression-portion-of-a-matching-expression