3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Two 9-dram clear styrene tubes with snap-on caps, 1 x 2-3/4″ I.D. (25.2 x 68mm), are supplied as containers. Additional or replacement tubes #8909 are available. As a safety precaution, BioQuip recommends using the #1135Y HEPA filter with this aspirator. Also see #1135X aspirator syringe bulb. It allows users to aspirate specimens without inhaling particulate matter."; $pat = "/#(\w+)/"; if ( preg_match_all($pat,$str,$matches)) { $popped = array_pop($matches); list( $alpha, $beta, $gamma) = $popped; echo "The IDs are as follows:\n\n$alpha\n$beta\n$gamma\n"; }
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
The IDs are as follows: 8909 1135Y 1135X

preferences:
185.26 ms | 404 KiB | 293 Q