So I have the string like this: *word/word: /2021-11?-[24] 15-12.xlsx
From this string, I want to match the characters from the following set [:\/?*[]], but the idea here is that I only want to match any of them once, and ignore any further finds.
My current solution using Regex library in C# is as follows:
string target = @"*word/word: /2021\-11?-[24] 15-12.xlsx";
string pattern = @"[:\\/?*\[\]]";
Regex.Matches(target, pattern);
Which gives the following result set [*,/,/,\,:,?,[,]]
What I'm after is something like [*,/,\,:,?,[,]] where duplicates are ignored.
And in cases like this:
*word/word: 2021-11-[24] 15-12.xlsx
Match [*,/,:,[,]] (It does not have to match every char from set.