This is not a duplicate. I have checked before asking.
I have this string separated with |
and I want to match the nth element.
aaaaaaaaa aaa|bb bbbbb|cccc ccccccc|ddd ddddddd|aaa aaa aaaaa|zzz zzz zzzzzzz
The closer I got is using this pattern but it buggy:
([^\|]*\|){2}[^\|]*
https://regex101.com/r/EYZbK5/1
This is plain pcre. In this context, javascript such .split()
cannot be used.
Say I want to get the 3rd element cccc ccccccc
what regex should I use?