C#C
C#12mo ago
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.
Was this page helpful?