Regular expressions can also help clean up input text for more aesthetic purposes. Let's assume we want to convert a blog title into URL-friendly characters...
While regular expressions are often used for input validation, I also find them very useful for cleaning malicious code in user input. For this I used the function preg_replace. The idea is that I only allow certain characters through... |
POPULAR BLOG TAGS
mbta
regular expressions
published
rot13
whoami
bakery
routes
sports
color
brain
general
gmail
usort
mit
skateboard
open source
email
spam
launch
hobnox
flash
security
ableton
google
cakephp
youtube
class
php5tube
encryption
code
science
defcon
release
drum machines
geek
boston
captcha
quicksilver
mailto
trice
php
magazine
germans
charlie
orwell
debuggeddesigns
1984
privacy
snowboard
as
|