What do you mean by "Regular Expressions" ?  In Real time, where we will use this? Give me some real time examples in which place we can go for RegularExpressions?

Showing Answers 1 - 1 of 1 Answers

Mythily

  • Sep 12th, 2005
 

While using an web application,if suppose u want to captured filed value that is alphanumeric for one iteration and numeric for another iteration,so we can't able to check/verify our result whether the field is alphanumberic/numberic,in this situation we can use regualr expression.

Example:1

str = "A222";

if(match(str,"[A-Z][0-9]")>0) # Condition Matches

{

  tl_step("Field Verification",0," The String Contain AlphaNumberic        Character");

}

else if(match(str,"[0-9]")>0)

{

  tl_step("Field Verification",0," The String Contain Numberic ");      

}

O/P

  The String contain alpha numeric Character

Example 2:

string = "2222"

Example:2

string = "22222"

if(match(str,"[A-Z][0-9]")>0)

{

  tl_step("Field Verification",0," The String Contain AlphaNumberic        Character");

}

else if(match(str,"[0-9]")>0) #condition matches

{

  tl_step("Field Verification",0," The String Contain Numberic ");      

}

O/P

  The String Contain Numberic 

Another method for using regular expression is:

if(string,"![A-Z][0-9]") == E_OK)

{

  statements;

}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions