© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
52 replies
Only in .NET stacks do we trust

✅ Regex pattern to match unique words each with 3 unique characters

Given a multiline input text:

abc
aaaa
bcde
acd
abc
abc
xyz
abc
aaaa
bcde
acd
abc
abc
xyz

I am looking for a regex pattern that matches unique words each consists of exactly 3 unique characters.
The expected output:
acd
xyz
acd
xyz


Edit:
For new visitors, this question can actually be solved with
negative lookbehind
negative lookbehind
and
negative lookahead
negative lookahead
.
If you are in hurry, you can jump to https://discord.com/channels/143867839282020352/1204500978741673994/1204519081663926304
and return again to this message ✅ Regex pattern to match unique words each with 3 unique characters in the future.
I may update with the solution. 🙂
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ confused with regex pattern
C#CC# / help
3y ago
Please help me with regex pattern
C#CC# / help
4y ago
❔ Match literal escape strings with a regex
C#CC# / help
3y ago
✅ Replace regex-pattern with dynamically generated string.
C#CC# / help
3y ago