var t1="N/A / I-10 / US 43"; var t2="US 72 / SR 21"; var exp=/(N\/A \/ I\-\d{2} \/ (US \d{2})|\2 \/ SR \d{2})/; alert( exp.test(t2) );