I am struggling with a regular expression. It is supposed to match only those strings that are a list of 3 words separated by |.
A word may contain any character (no newline etc., of course) but |
Examples:
word01|wörd|wä4rd # only this should be matched
word04|würd|wä4rd|of
word02|wörd|wä4rd|off|j
word01|wörd
I'd like to match those that have exactly 2 |. A simple count function could do it, but that is not available in my case. So I need a regular expression.
This obviously does not do the trick:
^[^\|]+\|[^\|]+\|+[^\|]$
What's the correct regular expression? What's wrong with my approach?