Jump to content

Tweak PHP (REGEX) comments filtration/validation script

Recommended Posts

I have a PHP comments filtration/validation script incorporated into my PHP/mysql custom built blog (under development).

This script uses REGEX to evaluate the format of user created comments.
This function is supposed to accomplish the following tasks:

  1. All code except those in the whitelist must be wrapped in the permitted bbcode tags.
  2. The bbcode tags can not be empty
  3. The bbcode tags must be used in pairs
  4. other forms of bbcode tag must be rejected except if wrapped in the permitted bbcode tag
  5. user can not post only code, some descriptive text must be added to explain code. this text can be before or after the code.
  6. posted comment string must satisfy minimum and maximum length criteria

I shall provide the developer with my current PHP script so he may understand how to lay the script out.


If your are good at REGEX, contact me.



Link to comment
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.