Rex Help

Post Reply
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

Rex Help

Post by KMandalia »

I want to do something like COMMAND:query where command is a single word.

Constraints:

1) I need to start on the fist character of the whole query and go upto the first :. I take everything upto but not including the first : and save it in one variable and take everything after the first : and reassign it to $ query.

So this is essentially breaking up user's query at first : from left.

2) Once I have it, I think i will use the switch statement to match it up against set of pre-defined command (switch cases are case-sensitive right, so To<>TO?)
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Rex Help

Post by mark »

>>=[^:]+\F:
>>=[^:]*:\P?.*

Right switch is case sensitive. Use <lower> or <upper> before <switch> if you want to ignore case.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

Rex Help

Post by KMandalia »

Whoa.

You guys are super fast and great.
Post Reply