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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 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
Source Ryan Shripat
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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