Help with searching in a string

Joined
Mar 30, 2011
Messages
1
Reaction score
0
So I'm working with pulling information out of SQL check constraints which I have as strings.

So I want to take a string like
([helicopter]=(-1) OR [helicopter]=(-5) OR [helicopter]>=(0) AND [helicopter]<=(4))
and make a message that says "Helicopter must be between 0 and 4."

Or take
([behavior]=(-1) OR [behavior]=(0) OR [behavior]=(0.5) OR [behavior]=(1) OR [behavior]=(2) OR [behavior]=(3))
and make a message that says "Behavior must be 0, 0.5, 1, 2, or 3."

But I'd like one way to do it that could handle slightly different strings. Take, for example, the two strings above.
Ideally my message box ends up ignoring the negative numbers. But there are two negative numbers in the first string and only one in the second.
And obviously there is a difference between "must be between 0 and 4" and "must be 0, 0.5, 1, 2, or 3."

Any suggestions for how to pull out/communicate what I need?
 
Back
Top