var s = "592 bla 44|769680790970 blabla (568|695) К89"; a = /\s.(\d+)\|(\d+).\s/g.exec(s) alert(a[1]); alert(a[2]);