1

EX:

SELECT DISTINCT city
FROM   station
WHERE CITY REGEXP '^[aeiou].*[aeiou]$'
zaki98
  • 1,048
  • 8
  • 13
  • 2
    It's a REGEXP is short for "regular expression", which is a text matching language. https://dataschool.com/how-to-teach-people-sql/how-regex-works-in-sql/ – David Browne - Microsoft Mar 19 '23 at 13:52
  • A good place to start: [What does this regex mean?](https://stackoverflow.com/questions/22937618/reference-what-does-this-regex-mean) – Bohemian Mar 19 '23 at 22:32

1 Answers1

2

This is a Regular Expression (Regex for short). It is a more or less simple way of performing very complex and versatile searches over text. In this case, the dot (.) means "any character", and the asterisk (*) means "any times", from none to "infinite". So, any of thouse examples whould be a positive match (any number of any characters, including no charachter):

ae
afu
adfo
efhhha
ahjhjfgjdha
azdgsdfhshsdfgsu
(etc)..

The following web gives a nice visual explanation of regexs: https://www.dcode.fr/regular-expression-analyser

visual explanation of regex

Simulant
  • 19,190
  • 8
  • 63
  • 98
MundoPeter
  • 704
  • 6
  • 12