A regular expression can consist of patterns grouped in parentheses, also known as capturing groups. In ([a-zA-Z])\s([0-9]), ([a-zA-Z]) is the first capturing group; ([0-9]) is the second capturing group.
Use a backreference to replace the pattern matched by a capturing group. In Perl, these groups are represented by the special variables $1, $2, $3, and so on. ($1 indicates text matched by the first parenthetical group.) In JMP, use a backslash followed by the group number (\1, \2, \3).
Regex(
" Are you there, Alice?, asked Jerry.", // source
" (here|there).+ (\w+).+(said|asked) (\w+)\.", // regular expression
" I am \1, \4, replied \2." ); // optional format argument
" I am there, Jerry, replied Alice."
" I am \1, |
|
\4, |
|
replied \2." |