I want to extract sub string from string using regular expression ie. the following input/out list shows what i really want. i need to extract the dept filter conditions from a string. Here the word [dept] is constant.so what the kind of regular expression is useful to extract the sub string in this scenario
Input------------------------------------------------Output
Some conditions And [dept]=IT [dept]=IT
Some conditions And [dept]=IT Or [dept]=Account [dept]=IT Or [dept]=Account
Some conditions And [dept] IN ('IT','Account') [dept] IN ('IT','Account')
[dept]=IT And some conditions [dept]=IT
[dept]=IT Or [dept]=Account And some conditions [dept]=IT Or [dept]=Account
[dept] IN ('IT','Account') And some conditions [dept] IN ('IT','Account')