Solved

How do i match

Posted on 2002-03-03
2
147 Views
Last Modified: 2010-03-05
What i need to do is match NL and not N or L only NL how do i do it this is the code that I have so far os "NL" will become "BR" and N will not become B thats what i need to do

$new_post =~ tr/NL/BR/;
0
Comment
Question by:kplonk
2 Comments
 
LVL 1

Accepted Solution

by:
japhyRPI earned 20 total points
ID: 6838160
You're using tr/// when you should be using s///.  tr/// is for character-to-character translations.

Also, you'll want s/NL/BR/g, which changes ALL occurrences of "NL" to "BR".
0
 

Author Comment

by:kplonk
ID: 6838207
thanks saw the mistake as soon as i read the post, thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

932 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

16 Experts available now in Live!

Get 1:1 Help Now