Question: I got part of a sentence in my database like :

```
beautiful house close to the beach
this peaceful touristic area
under a beautiful tree
behind the property

```

I would like to select sentence that does not contain a list of word like 'to','a'

Wanted result:

```
 this peaceful touristic area
 behind the property

```

I figured that I had to use something like

```
SELECT ID_sentence
FROM sentence 
WHERE semi_sentence NOT RLIKE '(.*)[^A-Za-z]to[^A-Za-z](.*)' 
AND semi_sentence NOT RLIKE '(.*)[^A-Za-z]a[^A-Za-z](.*)' 

```

but I can't get the regex right and I should probably group the list under one regex

Answer: 
You can use *word boundaries* applied to the *group* of two alternatives listed after `|` operator:

```
WHERE semi_sentence NOT RLIKE '[[:<:]](to|a)[[:>:]]'

```

See [what this regex matches](https://regex101.com/r/vA5dB1/1) (you will get those that do not match since you are using `NOT`, and `\b` is used in PCRE instead of both `[[:<:]]` (leading word boundary) and `[[:>:]]` (trailing word boundary)).
1. you can try `'.*?\sto\s.*'` and `'.*?\sa\s.*'`.
2. or add `?` after the first `.*` in you sentence.

thanks.