Question: I am trying to come up with a regex that would return a string between an uppercase letter or a number followed by a : and ended by a ?. So a statement like 
"2: who wrote The Hitchhiker's Guide to the Galaxy?" would find a match, where a statement like " Douglas Adams" would not be. Right now I have a series of indexOf's and substrings and I am wondering if a regex would be a more elegant solution.

Answer: 
If you know that those characters are the delimiters then your method of doing this is most likely fine. However, an easy to understand regular expression would be the following:

```
[A-Z0-9]:(.*?)\?

```

Example usage:

```
Match m = Regex.Match(input, @"[A-Z0-9]:(.*?)\?");
if (m.Success) {
    Console.WriteLine(m.Groups[1].Value.Trim()); 
} 

```
> 
> I am wondering if a regex would be a more elegant solution.
> 
> 
> 

This would surely be simpler. Do you mean 'number' or 'digit'? I don't know c#, but the regular expression would be something like:

```
"[0-9A-Z]:([^\?]+)\?$"

```

your can test the expression here: <https://regex101.com/>