I have a problem with a regex, I have the following string
[date|Y-m-d]
which is a Token extracted from a text and I need to extract 'date' and 'Y-m-d', but I haven't been able to achieve my goal with the following regex, can someone help me
(?:\[)([^\|]+)(?:\])
The tokens can be like:
[date|Y-m-d] \\ should extract 'date' and 'Y-m-d'
[date|Y-m-d|today] \\ should extract 'date', 'Y-m-d' and 'today'