-1
<a title="Fruit" href="cate1.html" data-type="cate" />
<a title="apple" href="article1.html" data-type="article" />
<a title="orange" href="article2.html" data-type="article" />
<a title="Vegetable" href="cate2.html" data-type="cate" />
<a title="cabbage" href="article3.html" data-type="article" />

I want match apple,orange,cabbage.

Using <a title="(.+?)" href=".+?.html" data-type="article" /> gives me Fruit,orange,Vegetable.

What I can do?

nicael
  • 18,550
  • 13
  • 57
  • 90
  • http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags - generally it's a bad idea to parse html with regex – Athena Jul 22 '16 at 21:38
  • It doesn't give you Fruit, orange, Vegetable. It does give you *exactly* what you want (apple,orange,cabbage), what is the problem? – nicael Jul 22 '16 at 21:40

1 Answers1

0

https://regex101.com/r/tL6eC4/1

title="([a-z]+)"

This match what you want, they are in lower case.

chikincrow
  • 393
  • 3
  • 11