my $regexLockParams = '(?:[\\s,]+' ."|(?:$regexSubstringOf{angle}|$regexSubstringOf{offset})\\s*$regexNumber" ."|$regexSubstringOf{dispersion}\\s*$regexNumber" #."|..." .')+'; #### sub safeCapture { # Workaround for Regex issue in which backtracked captures inside alternations inside repetition, will stomp on the capture value. my $prefix = shift; my $cap = shift; my $postfix = shift; return "$prefix($cap(?=$postfix))$postfix"; }