:
country REGEXP ('^(USA|Italy|France|)$')
| France, , ^$, country = ''.
:, , :
country REGEXP ('^(USA|Italy|France)$|^$')
, : ^(USA|Italy|France|.{0})$, , . ^(USA|Italy|France)$|^.{0}$ .
:
select '' regexp '^(USA|Italy|France)$|^$'
> 1
select 'abc' regexp '^(USA|Italy|France)$|^$'
> 0
select 'France' regexp '^(USA|Italy|France)$|^$'
> 1
select ' ' regexp '^(USA|Italy|France)$|^$'
> 0
, , .
If you want to handle empty values the same way (for example, 0 spaces and 5 spaces are considered empty), you should use a regex:
country REGEXP ('^(USA|Italy|France|\s*)$')
This will cause the last line in the previous example to behave differently, i.e.:
select ' ' regexp '^(USA|Italy|France|\s*)$'
> 1
source
share