PHP strip certain tags with strip_tags
You cannot strip a certain list of tags with PHP’s strip_tags() function, you can only strip ‘all but’ tags. So in order to do so, you’ll need to use regular…
A bunch of ramblings about PHP programming, JQuery, MySQL and other 'stuff'
You cannot strip a certain list of tags with PHP’s strip_tags() function, you can only strip ‘all but’ tags. So in order to do so, you’ll need to use regular…
This horrendous regular expression will parse a string and return a valid email address from it. $email = "<'Freddy'> fred@live.com"; preg_match('/+(?:\.+)*@(?:(?:*)?\.)+(?:*)?/', $email, $match); echo $match; This will return: fred@live.com Basically,…
I’ve found an excellent online tool, where you can give it a regex, and it will spit out the PHP syntax for use with preg_replace, preg_match, etc. I’m forever getting…
Say you have a list of movie titles, and you want to either sort them, or search through them, and some of them have “The ” at the start, for…
Removing letters from a string using Regular Expressions. Very simple. but brain bending – All I wanted to do was remove a prefix from a string. The prefix was always…
Regular expressions — everyone loves them, right? Well, I am currently running Ubuntu, and I would normally use RegexBuddy – but cannot unless I use Wine, and I don’t really…