Need to construct regexp to this
2 1231 21231 2312 2123 22 2
Need to find only 2, not 1231, not 21231, only 2
So, my regexp is
^[[:digit:]]?{1}[2]{1}^[[:digit:]]?
Is it right ?
Sorry if my ask like a 'do it for me', but i really cannot into regexp.
UPD
input string 2 22 1312 123123 22312 21 2
need to match "2"
2 22 1312 123123 22312 21 2
with or w\o digits after\before
input: "12 34"andoutput: "2", possibly using some character to find that's not ambiguous.