Nummer filteren
De nummers/cijfers zijn elke keer anders,
<p>(2014160554)</p>
<p>2014159870</p>
<p align="left">(2014110929)</p>
(2014112730)
<p>2014108351, 2014108375</p>
<p align="left">2014100181, 2014100218, 2014100236, 2014100244, 2014100243</p>
(2014099293/2014091697)
(2014097728, 2014097730, 2014097749, 2014097753)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$str = '<p>(2014160554)</p>
<p>2014159870</p>
<p align="left">(2014110929)</p>
(2014112730)
<p>2014108351, 2014108375</p>
<p align="left">2014100181, 2014100218, 2014100236, 2014100244, 2014100243</p>
(2014099293/2014091697)
(2014097728, 2014097730, 2014097749, 2014097753)';
preg_match_all('!\d+!', $str, $matches);
echo '<pre>';
print_r($matches[0]);
echo '</pre>';
?>
$str = '<p>(2014160554)</p>
<p>2014159870</p>
<p align="left">(2014110929)</p>
(2014112730)
<p>2014108351, 2014108375</p>
<p align="left">2014100181, 2014100218, 2014100236, 2014100244, 2014100243</p>
(2014099293/2014091697)
(2014097728, 2014097730, 2014097749, 2014097753)';
preg_match_all('!\d+!', $str, $matches);
echo '<pre>';
print_r($matches[0]);
echo '</pre>';
?>
Lorem ipsum 578 dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt<p>(2014160554)</p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt Lorem ipsum dolor sit amet, consectetur (TWN 2014096480/ NOG 2014151660) adipiscing elit, sed do eiusmod tempor incididunt<p>2014159870</p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt<p align="left">(2014110929)</p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt(2014112730)Lorem ipsum dolor sit amet, consectetur 06 12345678 adipiscing elit, sed do eiusmod tempor incididunt<p>2014108351, 2014108375</p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt<p align="left">2014100181, 2014100218, 2014100236, 2014100244, 2014100243</p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt(2014099293/2014091697)Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 12 tempor incididunt(2014097728, 2014097730, 2014097749, 2014097753)Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor 666 incididunt <img src="image.jpg" />.
Ik wil dus alles wat dik gedrukt is filteren/verwijderen.
Dus de regex zal moeten zeggen dat als er 10 cijfers aan elkaar gevonden zijn eruit filteren, staan er 2() omheen dan erbij filteren, staan er <p></p> omheen ook filteren ect..
Gewijzigd op 14/11/2014 22:13:38 door Ferdi R