I am trying to code some stuff in HTML, CSS and Javascript. I have some problems with regex.
Let me take a simple example to explain my problem because I can't find the solution.
<script>
var str = "I am <b>a tennis player</b> but I like also playing <i>football</i> and <i>rugby</i>, I am <b>34</b> years old, I like <u>cooking</u> even if there is nothing in common with <i>tennis</i>, <i>football</i> or <i>rugby</i>.";
var result = str.match(/<b>(.*?)<\/b>/g).map(function(val){
return val.replace(/<\/?b>/g,'');
});
alert(result)
</script>
So as you may have guessed it, I am looking for selecting all the text between the tags <b></b>,<i></i>,<u></u>. To be clearer I want to be able to select "a tennis player", "football", "rubgy", "34", "cooking" etc.
For the moment, I managed to deal with only one tag. When I try with several ones I fail. I have no experience on regex (I didn't study and work in this field) and the courses I found on the internet didn't answer my question. I don't think it is difficult to combine three regex, but I am lost with clast, with AND or OR etc. :/