My regex is (pnr|(P|p) _.:,!"'-/$ _.:,!"'-/$)+[ _.:,!"'-/$]+[0-9]{3}[ _.:,!"'-/$]+[0-9]{7}
It is extracting pnr number from column .
sample text : 94eb2c0cb17ef354bb052c57f40c\r\nContent-Type: text/plain; charset=UTF-8\r\nContent-Transfer-Encoding pnr:986-097832
94eb2c0cb17ef354bb052c57f40c\r\nContent-Type: pnr:986-097832 text/plain; charset=UTF-8\r\nContent-Transfer-Encoding
pnr:986-097832 94eb2c0cb17ef354bb052c57f40c\r\nContent-Type: text/plain; charset=UTF-8\r\nContent-Transfer-Encoding
I have to create a mysql query which will extract only the pnr number
For Oracle we can do something like below -
Try SUBSTRING_INDEX
sample