I'm looking for matching string "Order By XXX", where XXX can be any letter, number, period, comma, space or square bracket. However, I would only like to compare this if it is not surrounded by parentheses (the brackets on one side are okay, if it is not on both sides). Therefore, it must correspond to the italicized course from "", since it must not correspond to anything in
Corresponds (section in italics):
- Choose X from Y order on z
- Choose y = (select top 1 Z from C Order by [ID] desc)
Cannot match:
- Choose X from Y (z order)
- Select group aa, NTILE (4) OVER (Order by ab) with ac
I have a string of regular expressions to match the order in the text: [ ]*order by [\w,.\[\] ]+ . However, I have some problems getting an idea / at work properly. Any tips on how to proceed?
c # regex lookbehind lookahead
Yaakov ellis
source share