fork(2) download
  1. <?php
  2.  
  3. $input = <<<EOD
  4. inetnum: 81.25.48.0 - 81.25.51.255
  5. netname: UltraNet-Main-Net
  6. descr: JSC Lan-Telecom
  7. country: RU
  8. admin-c: XL-RIPE
  9. tech-c: XL-RIPE
  10. status: ASSIGNED PA
  11. mnt-by: LAN-TELECOM-MNT
  12. mnt-lower: LAN-TELECOM-MNT
  13. mnt-routes: LAN-TELECOM-MNT
  14. source: RIPE #Filtered
  15.  
  16. person: Konstantin A Ploshenko
  17. address: Lavochkina str., 34
  18. address: 125581, Moscow, Russia
  19. phone: +7 495 2589110
  20. fax-no: +7 495 2589110
  21. nic-hdl: XL-RIPE
  22. source: RIPE #Filtered
  23. mnt-by: XL-MNT
  24.  
  25. % Information related to '81.25.48.0/22AS39463'
  26. route: 81.25.48.0/22
  27. descr: JSC Lan-Telecom
  28. origin: AS39463
  29. mnt-by: LAN-TELECOM-MNT
  30. source: RIPE #Filtered
  31.  
  32. EOD;
  33.  
  34. $regexp = '/address:\s*(.*)/';
  35. preg_match_all ($regexp, $input, $matches);
  36. foreach($matches[1] as $match) {
  37. echo $match, PHP_EOL;
  38. }
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Lavochkina str., 34
125581, Moscow, Russia