Connecting Tech Pros Worldwide Forums | Help | Site Map

make a regex

dbdariusz
Guest
 
Posts: n/a
#1: Mar 15 '08
Hi

input:
<!-- comment -- <script><!-- comment --</scritp <!--
comment -->

output:
<script><!-- comment --></scritp>


Now I can find just every comment:
<!--.*?-->

maybe sombody help me..thx

Mason Barge
Guest
 
Posts: n/a
#2: Mar 16 '08

re: make a regex



"dbdariusz" <dbdariusz@gmail.comwrote in message
news:be23801f-17cf-49b7-b458-3f105b7c9677@s19g2000prg.googlegroups.com...
Quote:
Hi
>
input:
<!-- comment -- <script><!-- comment --</scritp <!--
comment -->
>
output:
<script><!-- comment --></scritp>
>
>
Now I can find just every comment:
<!--.*?-->
>
maybe sombody help me..thx
OK, first a little scolding, LOL. This isn't written as a PHP question and
even if it were, you would have to specify what flavor of regex you are
using.

It really should be reasonably easy to do if you understand how to use
possessive quantifiers. IIRC, PCRE is better/easier for possessive
quantifiers than POSIX, although I don't know much about POSIX.

Closed Thread