What is the main difference between '[[:space:]]' and '\s' in Oracle pl-sql regular expression? I have a string like this x=y AND z=y AND p=q , I need to replace every (space)AND(space)  pattern with * so that the original string turns into x=y*z=y*p=q. I'm using Regular expression for this cause the important thing is that there might by more that one space before and after each AND .
I've written two different queries for this
 query1:

 select regexp_replace('x=y AND z=y AND p=q','[[:space:]]AND[[:space:]]','*')
 from dual;


query2:

 select regexp_replace('x=y AND z=y AND p=q', '\s+AND\s+', '*')
 from dual;

I want to know :

Are there better ways to do that?
What is the main difference between these two queries? I mean[[:space:]] and \s? The important thing is that I want to know In what sort of condition these two queries will produce different result?

Thanks in advance
The Oracle documentation confirms that the POSIX expression [[:space:]] is equivalent to the Perl-style \s. I personally prefer \s because it's shorter, and also supported by many text editors.
In your example you have [[:space:]] (one whitespace character) but \s+ (one or more whitespace characters). Maybe that should have been [[:space:]]+.