We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I’m working on a CRUD project to allow MODx to hook up to some external databases that one of my sites deal with, and one of the common tasks here is to filter the data before we send it to that database... so there are a number of regular expressions.

    What are your favorite regular expressions? What kind of data do you find yourself needing to filter?

    Examples:
    ip address
    email
    phone numbers

    If you have the actual code for a preg_match() or preg_replace() function, that’d be great, but it would also be helpful to know what people use the most to make sure my library is as thorough as possible.

    Thanks!