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

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 6 regular expressions found.

   Displaying page 1 of 1 pages; Items 1 to 6
Title Test Details Pattern Title
Expression
</?(\w+)(\s*\w*\s*=\s*("[^"]*"|'[^']'|[^>]*))*|/?>
Description
Matches HTML of XML tags, with or without attributes (single-, double-, or non-quoted), closing tags, or self-closing singleton tags.
Matches
<font color="blue"> | </font> | <br />
Non-Matches
this is a test...
Author Rating: Not yet rated. Jean-Philip Losier
Title Test Details XML Tag
Expression
<(\w+)(\s(\w*=".*?")?)*((/>)|((/*?)>.*?</\1>))
Description
This RE will match XML tag elements. All elements must be closed. Won't match nested tags
Matches
&lt;body&gt; text&lt;br/&gt;More Text &lt;/body&gt; | &lt;a href=&quot;link.html&quot;&gt;Link&lt;/a
Non-Matches
&lt;p&gt; Some Text &lt;p&gt; | &lt;hr&gt; | &lt;html&gt;
Author Rating: The rating for this expression. Michael Ash
Title Test Details Pattern Title
Expression
&lt;(?:[^&quot;']+?|.+?(?:&quot;|').*?(?:&quot;|')?.*?)*?&gt;
Description
This will match all tags in a string, it's good for stripping HTML or XML tags to get the plain text.It works with attributes that include javascript or &quot;&lt;&gt;&quot;. It will match all these &lt;hr size=&quot;3&quot; noshade color=&quot;#000000&quot; align=&quot;left&quot;&gt; &lt;p style=&quot;margin-top:0px;margin-bottom:0px&quot; align=&quot;center&quot;&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;5&quot;&gt;&lt;b&gt;UNITED STATES&lt;/b&gt;&lt;/font&gt;&lt;/p&gt; &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;
Matches
&lt;input type=button onclick='n&gt;5' value=test onmouseover=&quot;n&lt;5&amp;&amp;n&gt;8&quot; onm
Non-Matches
haven't found any exceptions yet
Author Rating: The rating for this expression. Toby Henderson
Title Test Details Get XML tag from string
Expression
<\?xml.*</note>
Description
This will find any XML within a string starting with the <?xml header and ending with the closing root tag. Replace </note> with your closing root tag. (use singleline and case insensitive) - I use this to pull xml written in a web document.
Matches
<?xml version="1.0" encoding="ISO-8859-1"?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>
Non-Matches
<?xml version="1.0" encoding="ISO-8859-1"?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></BADnote>
Author Rating: The rating for this expression. Denny Love
Title Test Details XML Tag Value
Expression
(?<=<TAGNAME.*>).*(?=</TAGNAME>)
Description
This regex gets the value within an XML Tag. For example, given the following tag: <Result>result is here</Result> it returns the string "result is here". Replace TAGNAME with your tag name.
Matches
<test>value</test> | <Result>some response</Result> | <name>Ryan Shripat</name> | <a href="http://www.mindbaseconsulting.com">Mindbase Consulting</a>
Non-Matches
<result>true</answer> | <name isLong="yes">Ryan Shripat</nameX> | random text
Author Rating: The rating for this expression. Ryan Shripat
Title Test Details XML Tag
Expression
(?<STag><)[/\?\s]*(?<Prefix>\w*:)*(?<TagName>\w*)\s*(?<Attributes>(?<Attribute>((?<AttributePrefix>\w*)\s*:\s*)*(?<AttributeName>\w*)\s*=\s*(?<AttributeValue>"[^"]*"|'[^']*'|[^>\s]*)\s*)*)\s*/?(?<ETag>>)
Description
Match a start/end XML tag
Matches
<xs:complexType name="includeType" mixed="true">
Non-Matches
...
Author Rating: The rating for this expression. Jin Feng
   Displaying page 1 of 1 pages; Items 1 to 6

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