Solved

IF/Else logic in Regular Expression

Posted on 2009-05-05
6
669 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
more than one jdk and one jre 1 43
difference of if loops 23 50
web application structure 18 77
arguments to jar 5 26
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

831 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