Hello. There is an arbitrary text.
1 fgj sel dfjkd prm jfkdl frm jkl tbl klk 2 ledk prm jkl jkk frm jkl tbl jkl fjj 3 jklj sel prm kljlk jkjkl jkkl tbl emel 4 rui jkljl sel jklj jklj prm jkjl 5 jljkj frm jkljl jlj tbl mjljlk It is necessary to take regular blocks that start with sel and end with tbl and at the same time contain prm and frm. Those. The block consists of a sequence of words sel prm frm tbl. As a result, the example should take part of the first line and part of the fourth and fifth line.
sel dfjkd prm jfkdl frm jkl tbl sel jklj jklj prm jkjl 5 jljkj frm jkljl jlj tbl He tried, but did not go.
(sel)*?(prm|frm)?*(tbl)
\bsel\b.*\b(prm|frm)\b.*\btbl\bexpression\bsel\b.*\b(prm|frm)\b.*\btbl\b, here\bis the word boundary,.*any number of any characters - Andrew NOP