You are here: Re: preg_match_all for dummies « PHP « IT news, forums, messages
Re: preg_match_all for dummies

Posted by "n.g." on 11/24/05 12:39

lookbehind assertion require fixed length string as its parameter.
but you intend to put arbitary length string between `<!--' and `[!'
so the solution can be
1, remove html comments first before do bbcode expansion.
2, change bbcode tags to something like `[!-- .* --!]', that is define
a new tag of bbcode comments, which is independent to html comments.



On 11/24/05, Kristen G. Thorson <kthorson@allegroconsultants.com> wrote:
> I am a regex retard.
>
> I am trying to pull keywords out of this crazy bbcode-like file, but
> only for bbcode-like code NOT enclosed in HTML comments. I currently
> have managed to create this regex:
>
> '/(?<!<!--)\[!(\w+)::.*!\](?!-->)/U'
>
> Which matches
>
> [!keyword::crazy bbcode!]
>
> and not
>
> <!--[!keyword::crazy bbcode!]-->
>
> That's a step in the right direction. But it includes in the match
> keywords within phrases like this:
>
> <!-- A sentence including some [!keyword::crazy bbcode!]. -->
>
> I want to ignore all bbcode within HTML quotes. How do I do this?
>
>
> thanks
>
> kgt
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Tomorrow will be a good day :-)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация