Re: regular expression and exact word search...
| From: | .: B i g D o g :. | Date: | Thu, 07 Nov 2002 13:12:28 +0000 |
| Subject: | Re: regular expression and exact word search... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123220@lists.php.net to get a copy of this message | ||
This should help u out...
http://www.php.net/manual/en/pcre.pattern.modifiers.php
On Thu, 2002-11-07 at 18:29, BAROILLER Pierre-Emmanuel wrote:
> I work with
> preg_match_all to get all matching words
> and preg_replace_callback to replace found sentences...
>
> before runing the php pass, I take results from a mysql table
> with a query like this : select * from mytable where content REGEXP
> '[[:<:]]theword[[:>:]]
>
> But... I can't get all entry where words is in...
>
>
> ".: B I G D O G :." <bigdog@venticon.com> a écrit dans le message de news:
> 1036666724.13267.68.camel@pclnxrhunter.digitalglobe.com...
> > Which functions are you using to do the regex stuff...
> >
> > That might help...also check out...
> >
> >
> >
> > On Thu, 2002-11-07 at 15:42, BAROILLER Pierre-Emmanuel wrote:
> > > Hi!
> > >
> > > does someone know how to find an exact word in a content with html tags
> ?
> > > I'm using a regexp like this :
> > >
> > > $searchRegEx = "'\b".$word_search."\b'msi";
> > >
> > > to get boundary word results, but... if the searched word is like 'word
> or
> > > word. or anything else, the
> > > regular expression doesn't work..
> > >
> > > if I remove the \b , I've got all words ( but without bound...)
> > >
> > > Any idea?
> > > (the big problem is I'm higlighting found sentences, and .. if the
> searched
> > > word is part of an html tag, it's very auwfull... )
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > --
> > .: B i g D o g :.
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
.: B i g D o g :.