I need regular expression to validate text for all words in text must be unique.
for example my text will be like
valid text->
“Advance|Paid|Regular|Next”
Invalid text->
“Advance|Paid|Paid|Regular|Next|Advance”
words are not fix it can be any thing.
Please help me how I can achieve it in .net
Yeah, it is possible using backreferences:
That will match expressions with repeated words, with the first instance of the word as a group. Either negate it to see if words are repeated, or use a replace to remove the words.
To use spaces instead of
|: