Hone your regex skills with this utility that will make a welcome addition to any developer’s toolbox. Thanks to the folks at PHPedit the GUI app allows you to tweak your PCRE regular expressions with much less fuss than reloading browsers.
RexExpEditor, which is a free download, evaluates your expressions as you type, and has two minor but notable differences from how you would approach the preg-* family of functions in PHP:
- the beginning and ending forward slashes are implicit, don’t type them in
- enclose each match expression in (parentheses), even if it is only one
On a related note, be sure to check out Simon Willison’s interesting use of preg_replace_callback() – make sure you send an html string as arg to the function, at least something enclosed in one set of tags.
Or this use of create_function() for stripping selected tags from an html string.