Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

make a regex

Question posted by: dbdariusz (Guest) on March 15th, 2008 08:55 PM
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's Avatar
Mason Barge
Guest
n/a Posts
March 16th, 2008
06:05 PM
#2

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.


 
Not the answer you were looking for? Post your question . . .
189,816 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors