I wish to use .NET Regex to create a regular expression that takes an input string and outputs a string with characters removed from the front, but the number of characters removed depends on the length of the input string.
The input string can be either:
'N' is always numeric and '123' can be any number combination. The '0' in the first two cases is always '0' and 'ROC' is always 'ROC'.
In each case, I just want to return the 'N' part. i.e.:
Thanks!
I presume that "123" part is always 3 digits, try this:
string value = Regex.Match(input, @"^ROC(\d{3}0)?(\d+)$").Groups[2].Value;