Question: In the follow string:

`WHERE c.column_2 = c.column1 AND b.column1 = c.column2 AND z.abc = f.bc AND b.abc = '[0]' AND icv.dt_fim = '31/12/4712' AND icv.colum2 = '3'`

I need to match only the sentences that have the follow pattern:

`AND b.abc = '[numbers]'`

My actual regex is: `/(AND)(.*)(\[[0-9]]')/g`

That matchs with: `AND b.column1 = c.column2 AND z.abc = f.bc AND b.abc = '[0]'`

What is the problem here?

Answer: 
You can use

```js
(AND)\s+(\S+)\s+=\s+'\[([0-9]+)]'

```

See the [regex demo](https://regex101.com/r/588mnQ/2). *Details*:

* `(AND)` - Group 1: `AND`
* `\s+` - one or more whitespaces
* `(\S+)` - Group 2: one or more chars other than whitespace
* `\s+=\s+` - `=` symbol enclosed with one or more whitespaces
* `'\[` - a `'[` string
* `([0-9]+)` - Group 3: one or more digits
* `]'` - a `]'` string
`(.*)` is an extremely loosely defined pattern that will give you lots of matches. I would check out [regex101](https://regex101.com/) to test your regex. If I understand your question correctly, then `AND b\.abc = '\[[0-9]+\]'` is the pattern you want.