-3
<a rel="profile-edit" class="app js-user-name" href="/profile/0471482493?from_my_profile=1">Mia</a></b>   <

Hello I have a variable defined with the above text can someone please tell me the regex that would be required to extract jst the word "Mia" from the html? The word will not always be Mia.

Thank you in advance

Matt
  • 11
  • Hello and welcome to Stackoverflow. Please try to use a search prior to asking a question. Possible duplicate of [Extracting text from HTML file using Python](http://stackoverflow.com/questions/328356/extracting-text-from-html-file-using-python) – tfv Apr 23 '16 at 14:38
  • A simple one can be `/([A-Z])\w+/g` and a safer one can be `/\w+(?=<)/` – Redu Apr 23 '16 at 14:40
  • Thanks, I searched a bit but not enough I will check it out. :) – Matt Apr 23 '16 at 14:56
  • Nope neither worked, why are people down voting my question? – Matt Apr 23 '16 at 15:05
  • @Matt Do you have to take regex? You can get the word with javascript. `innerHTML` – John Apr 23 '16 at 15:26
  • Hey, no actually I don't have to use regex. I am working on a ubot which allows js functionality. Thanks – Matt Apr 23 '16 at 15:27

1 Answers1

1

Use this pattern:

/>.*?([^<]+)/

Online Demo

Shafizadeh
  • 9,960
  • 12
  • 52
  • 89