<p>I have a pattern to match with the string:
string pattern = @"asc"
I am checking the SQL SELECT query for right syntax, semantics, ...
I need to say that in the end of the query string I can have "asc" or "desc".
How can it be written in C#?</p>

You want the "alternation" operator, which is the pipe.
For instance, I believe this would be represented as:
```
```
asc|desc
```
```
If you want to make it a non-capturing group you can do it in the normal way. I'm not a regex expert, but that's the first thing to try.
EDIT: MSDN has a page about
regular expression language elements
which may help you.