Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I have string like this
[a] = ? and [b] = ? and [c] > ? or ([d] in [e] and [f] = ?)

how can i get matches with regex like this
1 - [a] = ?
2 - [b] = ?
3 - [c] > ?
4 - ([d] in [e] and [f] = ?)
Posted
Comments
Sergey Alexandrovich Kryukov 8-Jan-16 17:52pm    
How it can be related to SQL? The problem is not defined...
—SA
Maciej Los 9-Jan-16 5:24am    
This is not well formed question. We can't read in your mind or direct from your screen. Please, be more specific and provide more details.
What database? What are you trying to achieve? What have you tried? Where are you stuck?

1 solution

Regex can not nest. You need to properly parse the text. Regex can be used to tokenize, though.
Regards
Andi
PS: I assume you have potentially more complex expressions, e.g. expressions with nested (...).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900