http://www.perlmonks.org?node_id=850580


in reply to find one by one occurances

You could split your string into words and examine each word.

If the word contains four connected digits, print the previous two words, the examined word itself, and the following two words.