Solved

IF/Else logic in Regular Expression

Posted on 2009-05-05
6
670 Views
Last Modified: 2012-06-21
Hi

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

THanks

Theepan
0
Comment
Question by:justin_smith
  • 2
  • 2
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24311134
0
 
LVL 84

Expert Comment

by:ozo
ID: 24311203
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.
0
 

Author Comment

by:justin_smith
ID: 24311231
ozo,

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

Thanks

Theepan
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 84

Expert Comment

by:ozo
ID: 24311255
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?
0
 

Author Comment

by:justin_smith
ID: 24311269
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

Thanks

0
 
LVL 92

Expert Comment

by:objects
ID: 24311464
another discussion here
http://www.omegacoder.com/?p=56


what flavor of regexp do you need to use?

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question