[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Quick Regular Expression Question

Posted on 2006-06-23
2
Medium Priority
?
263 Views
Last Modified: 2006-11-18
Alright in the PHP site I'm building there are tags like [img]url[/img]. These will appear in big strings of text that present posts. How can I use a regular expression to strip [img]image.jpg[/img] out for example, but image.jpg can be anything! This is because I dont want tags and their attributes to appear in search results.

Thank you for your help. Code would be nice.
0
Comment
Question by:Linky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 200 total points
ID: 16969512
Hi Linky,

preg_replace('/\[img\].*?\[\/img\]/', '', $text);

Regards,
Zyloch
0
 
LVL 2

Author Comment

by:Linky
ID: 16969617
Thank you very much.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

650 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