Results 1 to 3 of 3

Thread: Regex help

  1. #1
    Join Date
    Aug 2005

    Regex help

    I used these on project sometime ago, but can remember what they do;

    $str = preg_replace("#[&].{2,7}[;]#sim", " ", $str);
    $str = preg_replace("#[()^!\"\$%&/{(\[)\]=}?`,;.:\-_\#'~+*]#", " ", $str);
    $str = preg_replace("#\s+#sim", " ", $str);

  2. #2
    Join Date
    May 2009
    Markham, Canada
    I would not expect anyone would decipher these for you as it is quite a tedious task. Here is the link you need:

  3. #3
    Join Date
    Feb 2005
    Looks like they're just filtering special characters (html-coded or not) and replacing with a single space. A better approach would be to define what characters you are willing to accept and define those in your regexp.

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

Similar Threads

  1. RegEx Help please!
    By csparks in forum Programming Discussion
    Replies: 3
    Last Post: 01-20-2008, 09:21 AM
  2. Replies: 2
    Last Post: 03-30-2006, 05:10 PM
  3. Regex help
    By Fallzone in forum Programming Discussion
    Replies: 3
    Last Post: 07-05-2005, 12:21 PM
  4. Regex help please!
    By OMaHTLD in forum Programming Discussion
    Replies: 5
    Last Post: 08-27-2004, 08:58 PM
  5. regex
    By koorb in forum Programming Discussion
    Replies: 2
    Last Post: 11-14-2003, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts