IF/Else logic in Regular Expression


I am facing situation where i need create the logic that is similar to a ternary operator.

I dont have the freedom to use any mainstream languages.

This is what i need to do

If something is blank do this other something else


Who is Participating?
What non-mainstream  languages do you have the freedom to use?
what do you want to do if something is blank?  what do you want to do if not?
regular expressions themselves don't really do anything other than match or not match
sometimes other languages may use the matching result from the language described by the regular expression to do something like substitute the string that was matched.
justin_smithAuthor Commented:

i can only put regex into a third party interface.. this accept regex..

Ok this is what i want to do..

If variable CONFIG is blank variable MESSAGE should be assigned the text BLANK else FULL

This is not exactly what i want to do..

But logic is easily ported


Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Does this third party interface that accepts regular expressions have a means for specifying which variables to test and assign?
Does this interface return anything that you can them use to do an assignment yourself?
justin_smithAuthor Commented:
It is not so much developer friendly..

But i can see what is eventually assigned by getting an SMS..

If you could structure the Regex i might be able to tweak it according the way the thirdparty interface works.. hopefully


another discussion here

what flavor of regexp do you need to use?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.