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 Pattern Title
Expression
<[^>]*>
Description
HTML Pattern Matching PLEASE HELP /&lt;[^&gt;]*&gt;/ig The above pattern is only successful when html tag are simple (they don't include any javascript). This mean that the pattern will fail if something like this is within the tag &lt;input type=button value=test onclick='if(n.value&gt;5)do_this();'&gt;. It will not match the entire open n close sign. How do you write a pattern that will pass all these tag so that the pattern will match from the open to the close sign and not when it just see a &gt; within a '' or &quot;&quot;. &lt;input type=button onclick='if(n.value&gt;5)do_this();'&gt; not this &lt;br&gt; &lt;input type=button onclick=&quot;n&gt;5?a():b();&quot; value=test&gt; not this &lt;br&gt; &lt;input type=button onclick=&quot;n&gt;5?a(\&quot;OK\&quot;):b('Not Ok');&quot; value=test&gt; not this &lt;br&gt; &lt;input type=button onclick='n&gt;5' value=test onmouseover=&quot;n&lt;5&amp;&amp;n&gt;8&quot; onmouseout='if(n&gt;5)alert(\'True\');else alert(&quot;False&quot;)'&gt; not this &lt;br&gt; Any help would be greatly appreciate. Thanks a whole lot. Logan
Matches
<html>
Non-Matches
abc
Author Rating: The rating for this expression. Logan Tran
Title Test Details Pattern Title
Expression
&lt;(.*?)&gt;
Description
Can anyone help me with this problem? I want X to give me the correct index of &gt;. For example if this is my code: var MsgString=&quot;&lt;button onclick='4&gt;5?a():b();'&gt;&quot;; X=MsgString.search(/&gt;/ig); X will give me 18 instead of 30. How can I get it to ignore &gt; that are within quotes? Please help. I would really appreciate it if anybody could give me some advice. Thanks so much. -Logan
Matches
&lt;test a&gt;
Non-Matches
none
Author Rating: Not yet rated. Logan Tran
   Displaying page 1 of 1 pages; Items 1 to 2

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