Regex help



Hello, i am regex newbie. I want to extract text between 2 markers. I want all the text that happens to be between <h2> and </h2>.

So far I got this:
<h2>.*</h2>

for this sample input:
<h2>hello</h2>
<h2>goodbye</h2>
<h2>wait</h2>

However, the regex also returns the markers, while I only want hello, goodbye, wait.

I know I can Substring it, but I want to do it with regex alone.

Thanks.
.



Relevant Pages

  • RE: Extract the desired value from a regex
    ... Extract the desired value from a regex ... property of Persistent Systems Ltd. ... Systems Ltd. does not accept any liability for virus infected mails. ...
    (perl.beginners)
  • Re: Regex question
    ... structure of the date you're trying to extract. ... For example, in Regex you can ... pattern that will ensure a valid date within the range allowed by T-SQL ... valid date from a string. ...
    (microsoft.public.dotnet.languages.csharp)
  • regular expression extracting groups
    ... I'm trying to use regular expressions to help me quickly extract the ... regex groups that I can easily access later. ... the key/value pairs but it ends up with only the contents of the last ... GROUP_SCHEMA = 'schema' ...
    (comp.lang.python)
  • Extracting Name Value Pairs
    ... Hi I have a long line of text that I want to parse for name/value pairs ... can i use RegEx to extract name value pairs? ... A resource for the Microsoft Dynamics Community ...
    (microsoft.public.scripting.vbscript)
  • Re: Regex question
    ... If you want to pull a valid date from a string, then you have to write a pattern that defines the lexical structure of the date you're trying to extract. ... What you're trying to do is simple by Regex standards, but still requires a lot more specificity than "a digit or a slash". ...
    (microsoft.public.dotnet.languages.csharp)

Loading