Home All Groups Group Topic Archive Search About

breaking information out of a string

Author
19 Jun 2006 6:51 PM
Smokey Grindle
I want to make custom tags that will go into a string like the following

"Follow this link [link url="me.aspx"]Link Title Text[/link]"

this is an example of course... but how would you go about creating a custom
tag system like this? I want to be able to take that and convert it into its
HTML equivilent

"Follow this link <a href="me.aspx">Link Title Text</a>"

thanks!

Author
20 Jun 2006 1:03 AM
Cowboy (Gregory A. Beamer)
I can think of a couple of ways. One is to look for tokens and parse them.
This is not elegant, but it will work as long as you cover all of your tags.

A better option is to study Regex and do Regex replacements. This performs
well, but will take a bit of a learning curve to get Regex down.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
Show quoteHide quote
"Smokey Grindle" <nospamhere@dontspam.net> wrote in message
news:uSIrDG9kGHA.4792@TK2MSFTNGP02.phx.gbl...
>I want to make custom tags that will go into a string like the following
>
> "Follow this link [link url="me.aspx"]Link Title Text[/link]"
>
> this is an example of course... but how would you go about creating a
> custom tag system like this? I want to be able to take that and convert it
> into its HTML equivilent
>
> "Follow this link <a href="me.aspx">Link Title Text</a>"
>
> thanks!
>
Author
20 Jun 2006 6:08 AM
Cor Ligthert [MVP]
Smokey,

I don't understand why you set it in this mnemonic code. I would not do it
that way, but if it is needed, than it needs in my opinion only two replaces
to set it in the wanted format. So I would use those replaces.

Cor

Show quoteHide quote
"Smokey Grindle" <nospamhere@dontspam.net> schreef in bericht
news:uSIrDG9kGHA.4792@TK2MSFTNGP02.phx.gbl...
>I want to make custom tags that will go into a string like the following
>
> "Follow this link [link url="me.aspx"]Link Title Text[/link]"
>
> this is an example of course... but how would you go about creating a
> custom tag system like this? I want to be able to take that and convert it
> into its HTML equivilent
>
> "Follow this link <a href="me.aspx">Link Title Text</a>"
>
> thanks!
>