2/13/10
Saturday 2:08pm
Date Posted: 2/13/10
Terrible time to be burned out with this PCRE, but I am. Here is what the most recent one looks like:
$text=preg_replace("/-(?!((?!</?(script|style|a)b).)*(</(script|style|a>)))/is","–",$text);
It replaces all hyphens with dashes unless it is located within a javascript, style script, or hyperlink. Inline styling will have the hyphens replaced with dashes, but that can be fixed by using classes.
TAGS: noneAll Memo Tags
allegory 1,
anime 1,
article 6,
audio 2,
books 3,
bug 19,
code 1,
commercial 1,
computer 15,
election 2,
ereader 5,
fixed 11,
games 24,
hard to remember 1,
history 1,
keyboard shortcuts 1,
links 3,
memo blog 1,
mini-review 10,
moving 2,
music 1,
mysql 1,
news 31,
none 1843,
opera 69,
politics 9,
private 15,
quotes 1,
reformat hard drive 19,
sgopc 1,
site update 15,
site version 205,
sleep 3,
star wars 2,
story 4,
swtor 1,
texas 1,
video 5,
website 22,
windows 10 1,
wishlist 3