Displaying page
of
pages;
Items to
| 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 |
<body> text<br/>More Text </body> | <a href="link.html">Link</a |
| Non-Matches |
<p> Some Text <p> | <hr> | <html> |
| Author |
Rating:
Michael Ash
|
| Title |
Test
Details
Pattern Title
|
| Expression |
<(?:[^"']+?|.+?(?:"|').*?(?:"|')?.*?)*?> |
| 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 "<>".
It will match all these
<hr size="3"
noshade
color="#000000"
align="left">
<p style="margin-top:0px;margin-bottom:0px"
align="center"><font face="Times New Roman"
size="5"><b>UNITED STATES</b></font></p>
<input type=button onclick='if(n.value>5)do_this();'> not this <br> <input type=button onclick="n>5?a():b();" value=test> not this <br> <input type=button onclick="n>5?a(\"OK\"):b('Not Ok');" value=test> not this <br> <input type=button onclick='n>5' value=test onmouseover="n<5&&n>8" onmouseout='if(n>5)alert(\'True\');else alert("False")'> not this <br>
|
| Matches |
<input type=button onclick='n>5' value=test onmouseover="n<5&&n>8" onm |
| Non-Matches |
haven't found any exceptions yet |
| Author |
Rating:
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:
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:
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:
Jin Feng
|
Displaying page
of
pages;
Items to