I am looking for a logic to remove all characters in a string except AD & Numeric values.
Examples
String | Expected Result |
---|---|
AD-892839 statement | AD-892839 |
BOD AD-89283 | AD-89283 |
BOD AD-89283 ACGD | AD-89283 |
I have tried to write a logic using regexp_replace but didn't get expected results.
In few cases we are receiving the transaction like AD-89823/1, AD-898232/2, AD-2283/5, etc.
A header | Another header |
---|---|
AD-892839 statement | AD-892839 |
BOD AD-89283 | AD-89283 |
BOD AD-89283 ACGD | AD-89283 |
BOD AD-89283/1,AD-89284/2,AD-89285/1 ACGD | AD-89283/1,AD-89284/2,AD-89285/1 |
AD-89283/1,AD-89284/2,AD-89285/1 TIOL | AD-89283/1,AD-89284/2,AD-89285/1 |