RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 2
Title Test Details remove HTML comments from html page
Expression
(\<!--\s*.*?((--\>)|$))
Description
matches comments <!-- --> in string. Singleline option must be enabled. It works well also with multiple comment start tags such as: <!--this is comment <!--and this as well and end-- of comment is!-- >right now-->. It also matches comments in between script or style tags <script> <!-- --> </script>
Matches
<!-- comment <!-- continuing -- >and ends now-->
Non-Matches
< !-- not comment -->, <a href="--">, all other html code
Author Rating: Not yet rated. David Havl
Title Test Details Get all code inside of php tag in page
Expression
(\<\?php\s+.*?((\?\>)|$))
Description
Get code in between php tag <?php and ?> or until end of string if end of tag not found. Singleline option must be enabled!
Matches
<?php this is code in php ?>
Non-Matches
text outside php tag
Author Rating: The rating for this expression. David Havl
   Displaying page 1 of 1 pages; Items 1 to 2

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials