Solved

replace

Posted on 2002-07-28
1
141 Views
Last Modified: 2010-03-05
How to replace all occurences of <a href="....">...</a> in my array named: @mdw

I want to have only the text between the <a href>and </a> tags.

Example:

If @mdw contains:

@mdw="<a href="..\test.htm>test</a>,<a href="..\finish.htm>finish</a>

I want it to contain:
@mdw="test,finish"
0
Comment
Question by:michael123199
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 50 total points
ID: 7183555
@mdw = ('<a href="..\test.htm">test</a>','<a href="..\finish.htm">finish</a>');
s/<\/?a\b(?:[^>'"]*|(['"]).*?\1)*>//sgi for @mdw;
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

Suggested Solutions

Title # Comments Views Activity
sort hash by values desc 2 185
Perl for loop for 2000 ms 7 95
Perl string replace for refred url 9 59
Perl Awk Need Help 3 109
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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 video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

929 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

10 Experts available now in Live!

Get 1:1 Help Now