I have to make a regex to match one digit only. it should match 7 and a7b but not 77. I made this but it doesn`t seem to work in sed.
(?<![\d])(?<![\S])[1](?![^\s.,?!])(?!^[\d])
(?<![\d])(?<!^[\a-z])\d(?![^a-z])(?!^[\d])
What am I doing wrong?
Edit:
I need to replace only 1-digit numbers with something like
sed 's/regex/@/g' file //regex to match "1"
file content
1 2 3 4 5 11 1
agdse1tg1xw
6 97 45 12
Should become
@ 2 3 4 5 11 @
agdse@tg@xw
6 97 45 12