Can you please help me identify a regex pattern for the below set of strings
1921 abc abc abc 1k
4320 abcs abc Apt 201b
1250 abcd Ave Apt 3c
61a abcd Ave
1b abcd Ave
39r abcd Rd
16w750 abcd Ave
abc 12a
The ask is to identify if a sentence contain a single character before, after or in between digits.
\d[A-Za-z]\d|\d[A-Za-z]|^[A-Za-z]\d
This is something I tried, but didn't work :)
Only a single character should be present.There can be many numbers.
You didn't really supply a precise definition but this does match your pattern:
Demo
If there is a possibility of non digits starting (which is not in your example) then use an alteration:
Demo