Solved

Remove everything between <[ and ]>

Posted on 2008-10-22
3
183 Views
Last Modified: 2008-10-22
I want to remove all instances of everything between <[ and ]>

This is a variation of this solution:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23837938.html
0
Comment
Question by:hankknight
3 Comments
 
LVL 35

Accepted Solution

by:
Terry Woods earned 500 total points
ID: 22780386
Try this
echo preg_replace( '#<\[.*?\]>#','', $str);

Open in new window

0
 
LVL 16

Author Comment

by:hankknight
ID: 22780569
0
 
LVL 82

Expert Comment

by:hielo
ID: 22780632
try:
echo preg_replace( '#<\[[^\]]*\]>#','', $str);

Open in new window

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

9 Experts available now in Live!

Get 1:1 Help Now