Can't get why this regex (regex101)
/[|]?([a-z0-9A-Z]+)(?:[(]?[,][)]?)?[|]?/g
captures all the input, while this (regex101)
/[|]+([a-z0-9A-Z]+)(?:[(]?[,][)]?)?[|]?/g
captures only |Func
Input string is |Func(param1, param2, param32, param54, param293, par13am, param)|
Also how can i match repeated capturing group in normal way? E.g. i have regex
/((s*([a-z\_]+){1}(?:s+,s+(d+)*)*s*))/gui
And input string is (( string , 1 , 2 ))
.
Regex101 says "a repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations...". I've tried to follow this tip, but it didn't helped me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…