preg_match regular expression to get text between tags

1

What would be the preg_match expression to get the text "exit" within the following tag?

<a href="/logout" role="menuitem">
                            <i class="icon-key"></i> Sair
                        </a>
    
asked by anonymous 10.07.2017 / 06:22

1 answer

1

The expression would look like this:

<a href="\/logout" role="menuitem">[\s]+<i class="icon-key"><\/i> ([a-zA-Z]+)[\s]+<\/a>
    
10.07.2017 / 06:38