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 Houston to blah blah"), $matches ) ) { var_dump($matches); }
based on gEK28
Output for 4.3.0 - 7.1.0
array(3) { [0]=> string(7) "O529012" [1]=> string(7) "O529012" [2]=> string(1) "O" }