Very often a website will have code that looks something like one of the following
Sample1
Code: Select all
<span class="field field--type-string hidden" property="schema:name">headline</span>
Sample2
Code: Select all
<span class="field field--type-string hidden">headline</span>
Code: Select all
"<span class=""field field[^>]+>(?P<Name>[^<]+)"
It would be great if someone can share a regex that will cover the following:
match something that starts with literal words for example in above it would be <span class=
next enter some more literal data in above it would be "field field" in regex so far we have "<span class=""field field
The next part is the key, now go until you hit a > meaning, all data not just char or numbers just everything until >
Then grab the text after that until you hit a </span> or </a> (in regex you would write the literal what you expect to hit).
I tried playing with (+.*) and I must have tried 30+ things but did not succeed