Advertisement

12.20.2006 at 05:05PM PST, ID: 22099988
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Preg_Replace entire URLs based on domain

Asked by Tomeeboy in PHP Scripting Language

Tags: ,

I'm a bit rusty with my regex (okay, really rusty) and I need to put together a small set of filters to weed out banned or unwanted links from a forum system.  Basically, I want to be able to specify a domain, such as website.com, and then filter a message for any URLs to that domain (whether in raw form or BBcode).  If found, the entire URL is removed or replaced (preferably replaced with a message or warning of some kind).  This would be done at the time of posting, and not on display.

Example:

"Hey everybody, go to http://www.bannedwebsite.com/id=23525&page=234234 for great deals on ..."

If I was filtering for "bannedwebsite.com", it would catch this and change the text to:

"Hey everybody, go to <spam link removed> for great deals on ..."

I think that in many cases, the URLs will also be inside of BBCode, so I need to check for these as well.  Examples of the BBcode used:

[url]http://www.bannedwebsite.com[/url]

and

[url=http://www.bannedwebsite.com]Click Me[/url]

I need some examples to achieve this, if anyone would be so kind as to help out.  I'm sure it's pretty simple to do, but my head is killing me just thinking about it at the moment :)  Thanks in advance!Start Free Trial
[+][-]12.20.2006 at 05:23PM PST, ID: 18177821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2006 at 05:26PM PST, ID: 18177833

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2006 at 05:30PM PST, ID: 18177845

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: preg_replace, domain
Sign Up Now!
Solution Provided By: soapergem
Participating Experts: 3
Solution Grade: A
 
 
[+][-]12.20.2006 at 05:30PM PST, ID: 18177848

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2006 at 06:23PM PST, ID: 18177958

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2006 at 06:43PM PST, ID: 18178015

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2006 at 02:14PM PST, ID: 18183724

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2006 at 02:46PM PST, ID: 18183910

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2006 at 03:08PM PST, ID: 18184099

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2006 at 03:25PM PST, ID: 18184234

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32