The question might be more confusing than what I am trying to do. Basically I want to get the content of the html <title
element:
s = s.match(/<title>(.*?)<\/title>/);
This gives me:
["<title>foobar</title>", "foobar"]
So to access the text only, I have to use s[1]
.
Is there any way to create a match with just the text, skipping "<title>foobar</title>"
? Or with other words: is there a way to tell match()
: "search for a string delimited with <a></a>
but ignore those delimiters in the result"?
I have tried various expressions with negative lookbehinds and such, but I wasnt lucky. I dont even know if that is the correct approach.