Answer the question
In order to leave comments, you need to log in
How to fix regular expression?
$str = '<div class="product-desc col-md-6">
<h1 class="product-title" id="productTitle" itemprop="name">Электродная система MCScap-NS5-2515</h1>
<p>NS233522 L (54-60 cм)<span class="redactor-invisible-space"></span>
</p>
<p>NS233522<span class="redactor-invisible-space"> L/M (51-57 см)</span><br>
</p>
<p>NS233522<span class="redactor-invisible-space"> M (48-54 sm)<span class="redactor-invisible-space"></span><br></span>
</p>
<p><span class="redactor-invisible-space">NS233522 M/S (45-51 см)<span class="redactor-invisible-space"><br></span></span>
</p>
<p><span class="redactor-invisible-space"><span class="redactor-invisible-space">NS233522<span class="redactor-invisible-space"> S (42-48 см)<span class="redactor-invisible-space"></span><br></span></span></span>
</p>
<p><span class="redactor-invisible-space"><span class="redactor-invisible-space"><span class="redactor-invisible-space">NS233522 XL (60-66 см)<span class="redactor-invisible-space"><br></span></span></span></span>
</p>
<p><span class="redactor-invisible-space"><span class="redactor-invisible-space"><span class="redactor-invisible-space"><span class="redactor-invisible-space">NS233522 XL/L (57-63 см)<span class="redactor-invisible-space"><br></span></span></span></span></span>
</p>
</div>';
preg_match_all('#NS(.*?). .#is', $str, $arr3);
print_r($arr3[1]);
Array (
[0] => NS233522
[1] => NS233522
[2]=>NS233522
[3] =>NS233522
[4]=>NS23352
[5] =>NS23352 )
NS5-2515
should not be Answer the question
In order to leave comments, you need to log in
help so that everything remains after the dot and dash
https://regex101.com/r/q2lVWD/9
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question