Solved

Checking to see if a part of a string exist in a certain string

Posted on 2000-05-10
4
207 Views
Last Modified: 2010-03-05
Suppose I have a string: PPP code.servername.iga.app.bbrc-object
and it is stored in a variable
$RC_LABEL

how do I CHECK TO SEE USING AN IF STMT
TO DETERMINE IF iga.app.bbrc-object IS PRESENT IN THE
WHOLE STRING( PPP code.servername.iga.app.bbrc-object)

THANKS.
0
Comment
Question by:CODER
4 Comments
 
LVL 12

Accepted Solution

by:
geotiger earned 30 total points
Comment Utility
use the following statement:

if ($RC_LABEL =~ /iga.app.bbrc-object/)  
0
 
LVL 25

Expert Comment

by:clockwatcher
Comment Utility
You may want to escape those periods.

if ($RC_LABEL =~ /iga\.app\.bbrc-object/)

0
 
LVL 8

Expert Comment

by:shlomoy
Comment Utility
if ($RC_LABEL eq "iga.app.bbrc-object")


if you want to check if your string is equal to "iga.app.bbrc-object"
0
 

Author Comment

by:CODER
Comment Utility
THANKS AGAIN!!!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now