I'm trying to do a regular expression in Oracle with the following requirement:
- Finish with a specific letter, if you have that letter in the middle do not search.
- Return the first 3 digits of the string.
To solve the first problem I can use:
a\b
The "a" being the letter, \b
to get a border position after the letter.
To solve the second problem, ie return the first 3 digits:
^(...){1,1}
Now how do I join the two conditions? Or the way I'm doing it would not work?
Examples, which end with the letter "a", need to return the first 3:
anh pro