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#?
Share
That’d look like
assuming that you’re mandating that asc/desc is the end of the query. You could also do
(?:asc|desc)$which is a little cleaner with the single$, but less readable.