How can I find a tag given its classmarket_listing_item_nameand get the text of this tag using a regular expression, provided that the regular expression will issue immediatelymatchand not groups?

<span id="result_0_name" class="market_listing_item_name" style="color: #;">Begin</span>


I didn't quite understand the question. Do you need to run through the regex the ENTIRE line with tags and so on, or do you just need to get the line inside the span by any means?

4500zenja2022-01-23 02:12:14

He needs to find the tag, taking into account the presence of the class, and get the text from this tag. Text only. No groupings

sousage12122022-01-23 02:12:14

If your tags can be nested, then it is impossible to solve the problem using RE. The regular does not understand recursion, and if the enclosing tag has the desired class, then its selection will not work correctly.

Sergey2022-01-23 02:12:14

Thank you all for your answers) Indeed, the text without groupings could not be obtained. I had to work with them.

ModNick2022-01-23 02:12:14