3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (preg_match( '/\b((IA|IO|A|O|D)[0-9]{6})(-*(R|revised)[\w]*)*\b/i', trim("Outbound Quote: O529012-R Houston to blah blah"), $matches ) ) { var_dump($matches); }
based on g4BAN
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> string(9) "O529012-R" [1]=> string(7) "O529012" [2]=> string(1) "O" [3]=> string(2) "-R" [4]=> string(1) "R" }