Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(\$\d) = '(.+?)'
/
g
Input 1
1
New
2017-03-31 09:41:18 EDT [12708-4] parameters: $1 = '0', $2 = 'ON', $3 = 'ON' Fairly obviously, I want the values for $1, $2 and $3. This particular example has 3 variables but it's generally between 1 and 15. I want a regex that will capture the following: $1 '0' $2 'ON' $3 'ON' This is my regex, which matches the first group: \d{4}.+\[[\d-]*\].+?parameters:\s((\$\d+)\s?=\s?(['\d+\w+]+)) but no combination of pluses, parentheses and commas produces anything near what I want. Even if I remove the commas from the string and just jam them together I can't get it to capture. This guy captures everything, but the groups don't make sense: \d{4}.+\[[\d-]*\].+?parameters:\s(((\$\d+)\s?=\s?(['\d+\w+]+),?\s?)+) Can someone end my misery here and explain to me how to capture repeated text in a regex if the text is separated by characters that I don't care about?
Substitution