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 1
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
   Displaying page 1 of 1 pages; Items 1 to 1

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