Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle Identifying multiple spaces using REGEXP_LIKE

I'm trying to identify fields that have more than one space in a comment, e.g. 'this lhas three spaces'

Using this I can get anything with two spaces, but would like to be able to get 2 or more:

select * from labtec.spaces
where REGEXP_LIKE(SPACES, '[[:space:]]{2}');

Any suggestions?

like image 821
Richard Ferguson Avatar asked Oct 11 '25 19:10

Richard Ferguson


1 Answers

I believe that you can:

select * from labtec.spaces
where REGEXP_LIKE(SPACES, '[[:space:]]{2,}');

Note the comma.

For "Between three and five" you would use {3,5}, for "two or more" {2,}, for "eight or less" {,8}

like image 55
David Aldridge Avatar answered Oct 14 '25 12:10

David Aldridge