I am trying to get the content from this paragraph but regex I am using is not working when I remove line brake from the paragraph then regex work otherwise it is not working please tell me what do I do?
Here is the paragraph:
<span class="st">My Paragraph - you can download free <b>drivers</b> for audio, video, chipset, Wi
Fi or USB, or a <b>driver</b> installation pack for <b>notebook</b>/(for ...</span><br></div>
My Regex:
preg_match_all('/<span class="st">(.+?[^\n])<\/span><br><\/div>/i', $file_strings, $ti);
When I use this paragraph it works
<span class="st">My Paragraph - you can download free <b>drivers</b> for audio, video, chipset, WiFi or USB, or a <b>driver</b> installation pack for <b>notebook</b>/(for ...</span><br></div>
Output should look like this
My Paragraph - you can download free <b>drivers</b> for audio, video, chipset, WFi or USB, or a <b>driver</b> installation pack for <b>notebook</b>/(for ...
as you can see I just removed line brake from wifi and it's working but I need regex which works without removing that line brake
See this screenshot where I am testing my regex Screenshot I am testing it here Regex tester
Solution By: @jonny-5
Adding iS instead of i after forward slash solved the problem
preg_match_all('/<span class="st">(.+?[^\n])<\/span><br><\/div>/is', $file_strings, $ti);