ORACLE : Select Rows Where First, Last or Both Characters are Special or Punctuation, excluding Dot '.' if Last

Asked

Viewed 46 times

0

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:

  1. 'GEORGE & SON ' - has an extra space at the end.
  2. '-GEORGE & SON' - has an extra '-' at the start.
  3. '&GEORGE & SON' - has an extra '&' at the start.
  4. '-GEORGE & SON S.A.' - has an extra '-' at the start. The Dot '.' at the end it’s not a problem.
  5. '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

  • Welcome to [en.so]! Please click on [Edit] and translate the question into Portuguese.

  • I am so sorry. I put this question in the American Stackoverflow and I got a satisfactory answer. I thank you for the comment hkhotsubo.

  • All right, you can still [Edit] the question and leave it in Portuguese if you like. Or delete it if you think it is no longer necessary. :-)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.