How to write a simple parser?
| From: | rodrigo | Date: | Tue, 28 Nov 2000 03:06:44 +0000 |
| Subject: | How to write a simple parser? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27511@lists.php.net to get a copy of this message | ||
I neeed to write a simple parser that will interpret simple commands and
convert them to HTML. The command tags start and end with square
brackets "[]". For example, if someone where to type
"[link:www.locatio.com | locatio]" then that would translate into "<a
href="www.locatio.com">locatio</a>".
It is just a way for users to avoid doing any HTML at all. I tried the
regular expression functions but they only return a TRUE/FALSE value. I
would like to be able to return the first part of the string, which has
the command in it.
Thanks in advance.
--
************************************
Ivan R. Quintero E.* (507)228-3477
Aptdo 1263 * (507)228-9105
Balboa, Ancon *
Republic of Panama *
************************************