© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•13mo ago•
20 replies
MC

Regex to match on full number only

Not really C# specific, but it is in a C# app that I'm working on.

I've got a List of Strings that contains various values in a consistent format (one or two digit number, followed by a single letter), that I need to search on the full number only.
Some example values are 1A,1B,10A,10B.

What I'd like to do is return matches on the full number only, so using the example data, if I search for 1, I'd only want 1A, and 1B as the result.
Off course, if there's an alternative to use regex to achieve this that I'm not aware off, then I'd be open to knowing about it.
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

Similar Threads

Create regex that returns the match only
C#CC# / help
4y ago
Regex to match text between nested tags
C#CC# / help
11mo ago
❔ Convert regex match groups into parameters
C#CC# / help
3y ago