Use lazy matching in your regex: <tr.*?</tr>
But as others have mentioned, it’s more robust to use a proper parser if you can.
More Related Contents:
- Turn Plain Text URLs into Active Links using PHP [closed]
- How to extract img src, title and alt from html using php? [duplicate]
- Extract URLs from text in PHP
- How to replace text URLs and exclude URLs in HTML tags?
- PHP Regular expression to match keyword outside HTML tag
- Strip all HTML tags, except allowed
- RegExp to strip HTML comments
- Need a good regex to convert URLs to links but leave existing links alone
- How to get Open Graph Protocol of a webpage by php?
- Count all HTML tags in page PHP
- How to convert multiple tag to a single tag in php
- Regex ignore URL already in HTML tags
- PHP/regex: How to get the string value of HTML tag?
- Route to image in Laravel [closed]
- Create hyperlink from html table row to open record on a new page
- PHP regular expressions: No ending delimiter ‘^’ found in
- Replace URLs in text with HTML links
- How to minify php page html output?
- How to upload images into MySQL database using PHP code
- How do I get the HTML code of a web page in PHP?
- How to force a file to download in PHP
- PHP remove special character from string
- Remove all the line breaks from the html source
- How to display string that contains HTML in twig template?
- How to write a recursive regex that matches nested parentheses?
- mysqli_query() expects at least 2 parameters, 1 given in? [duplicate]
- utf-8 special characters not displaying [duplicate]
- Turkish characters are not displayed correctly [duplicate]
- Detect Ajax calling URL
- Get non-numeric characters then number on each line of a block of texf