Re: regular expression
| From: | php@aeroinc.net | Date: | Fri, 06 Oct 2000 21:31:18 +0000 |
| Subject: | Re: regular expression | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18983@lists.php.net to get a copy of this message | ||
The trouble with <code> is that it ignores whitespace.
(At least with IE, didn't test with Netscape.)
People will be posting a lot of code snippets, and I
want it to preserve spacing like <pre>. But I'd rather
have it break, like <code>. So maybe there'd be a way
to convert all spaces within a <code></code> to ' '
with regular expressions?
I can resort to just looping through the string character
by character, but I thought maybe it could be done easily
with regular expressions.
--
Matthew Leverton - matthew@aeroinc.net
ORIGINAL MESSAGE
---------------------------------------------
Hi Matthew:
While this isn't exactly what you want, maybe it'll work...
Instead of converting [code] to <pre>, turn it into
<code>.