Re: [PHP] Re: string highlight

2005-06-08 Thread John Nichel
Rory Browne wrote: < won't be picked up as a word boundry (\b). Aparently it will. I stand corrected based on these two rules for \b since < and > are non-word characters... # Between a word character and a non-word character following right after the word character. # Between a non-wor

Re: [PHP] Re: string highlight

2005-06-08 Thread Rory Browne
On 6/8/05, John Nichel <[EMAIL PROTECTED]> wrote: > Rory Browne wrote: > > >>Good catch Rory. A regex replace would work better here. > >> > >>$search = "body"; > >>$find = "/\b" . $search . "\b/"; > >>preg_replace ( $find, "" . $search . "", $html ); > > > > > > I don't think so. If I'm reading

Re: [PHP] Re: string highlight

2005-06-08 Thread John Nichel
Rory Browne wrote: Good catch Rory. A regex replace would work better here. $search = "body"; $find = "/\b" . $search . "\b/"; preg_replace ( $find, "" . $search . "", $html ); I don't think so. If I'm reading your code correctly you still have the same problem, as I outlined above. There i

Re: [PHP] Re: string highlight

2005-06-08 Thread Rory Browne
On 6/8/05, Jay Blanchard <[EMAIL PROTECTED]> wrote: > [snip] > I don't think so. If I'm reading your code correctly you still have > the same problem, as I outlined above. There is no simple solution to > this. It either involves advanced regex(more advanced than my > understanding of it), or a pro

RE: [PHP] Re: string highlight

2005-06-08 Thread Jay Blanchard
[snip] I don't think so. If I'm reading your code correctly you still have the same problem, as I outlined above. There is no simple solution to this. It either involves advanced regex(more advanced than my understanding of it), or a proper parser. [/snip] Also it should be noted that the tag p

Re: [PHP] Re: string highlight

2005-06-08 Thread Jochem Maas
Rory Browne wrote: On 6/8/05, John Nichel <[EMAIL PROTECTED]> wrote: Rory Browne wrote: On 6/8/05, David Duong <[EMAIL PROTECTED]> wrote: Sebastian wrote: i'm looking for a function that can highlight certain search terms in a string. anyone have something already made that i can plugin

Re: [PHP] Re: string highlight

2005-06-08 Thread Jochem Maas
John Nichel wrote: Rory Browne wrote: On 6/8/05, David Duong <[EMAIL PROTECTED]> wrote: Sebastian wrote: i'm looking for a function that can highlight certain search terms in a string. anyone have something already made that i can plugin to my exisiting code? I found a couple but they do n

Re: [PHP] Re: string highlight

2005-06-08 Thread Rory Browne
On 6/8/05, John Nichel <[EMAIL PROTECTED]> wrote: > Rory Browne wrote: > > On 6/8/05, David Duong <[EMAIL PROTECTED]> wrote: > > > >>Sebastian wrote: > >> > >>>i'm looking for a function that can highlight certain search terms in a > >>>string. anyone have something already made that i can plugin t

Re: [PHP] Re: string highlight

2005-06-08 Thread John Nichel
Rory Browne wrote: On 6/8/05, David Duong <[EMAIL PROTECTED]> wrote: Sebastian wrote: i'm looking for a function that can highlight certain search terms in a string. anyone have something already made that i can plugin to my exisiting code? I found a couple but they do not work very well.. s

Re: [PHP] Re: string highlight

2005-06-07 Thread Rory Browne
On 6/8/05, David Duong <[EMAIL PROTECTED]> wrote: > Sebastian wrote: > > i'm looking for a function that can highlight certain search terms in a > > string. anyone have something already made that i can plugin to my > > exisiting code? > > > > I found a couple but they do not work very well.. some

[PHP] Re: string highlight

2005-06-07 Thread David Duong
David Duong wrote: Sebastian wrote: i'm looking for a function that can highlight certain search terms in a string. anyone have something already made that i can plugin to my exisiting code? I found a couple but they do not work very well.. some break html code if the string contains the ke

[PHP] Re: string highlight

2005-06-07 Thread David Duong
Sebastian wrote: i'm looking for a function that can highlight certain search terms in a string. anyone have something already made that i can plugin to my exisiting code? I found a couple but they do not work very well.. some break html code if the string contains the keywords in the html.