Hey there,
I have been working on this regex:
{link=([^|{}]+)\||([^|{}]+)\||([^|{}]+)}
I wish to capture any non-pipe or bracket chars and place them in appropriate backreference (group).
How can I return the following:
- If test string is
{link=a}
returna
into group 3. - If test string is
{link=a|b}
returna
into group 2,b
into group 3. - If test string is
{link=a|b|c}
returna
into group 1,b
into group 2,c
into group 3.
Having issues where the strings are not correctly being picked up into correct groups on all permutations with the above regex. I think I have bracket grouping issues and/or OR
(|
) statement issues.
Thanks in advance.