I need to retrieve rows from table, in the Column [Client Name].
My request is need to prevent Names that Start or End with a [:space:] or other special Character [:punct:], excluding the dot '.' - at the end of the Name. The Idea is to pull Names that are Possible inconsistencies.
examples that must appear:
- 'GEORGE & SON ' - has an extra space at the end.
- '-GEORGE & SON' - has an extra '-' at the start.
- '&GEORGE & SON' - has an extra '&' at the start.
- '-GEORGE & SON S.A.' - has an extra '-' at the start. The Dot '.' at the end it's not a problem.
- 'GEORGE & SON..' - has not one, but two dots at the end. That is an exception for the strings that ends with more than one '.'; they are also bad names.
examples that must not appear: 'GEORGE & SON.' - Only has an extra '.', at the end.
I'm using the expression: REGEXP_LIKE(col, '(^[[:punct:]]|[[:punct:]]$)|(^[[:space:]]|[[:space:]]$)') But in spite of retrieving Names that start or end with space or special characters, is also pulling the ones that have a dot '.' on last character.
Can anybody help me, please?
Leopoldo Fernandes Lisbon - Portugal