I was playing around with this challenge here: Weather Observation Station 12
And I tried submitting this answer:
SELECT DISTINCT CITY FROM STATION
WHERE CITY NOT REGEXP '^[aeiouAEIOU].*[aeiouAEIOU]$'
I know that this answer works (inspired by this very similar question):
SELECT DISTINCT CITY FROM STATION
WHERE CITY NOT RLIKE '^[aeiouAEIOU]' AND CITY NOT RLIKE '[aeiouAEIOU]$'
... But I couldn't write an accepted answer in a single regular expression. Can anyone explain why?
What it searches in
As a commenter pointed out, then above-written page requires login. So for good measures sake, I'll add here that it searches amongst 500 city-names, such as (each in their own row in the database):
Kissee Mills, Loma Mar, Sandy Hook, Tipton, Arlington, Turner, Slidell, Negreet, Glencoe, Chelsea, Chignik Lagoon, Pelahatchie, Hanna City, Dorrance, Albany, Monument, Manchester, Prescott, Graettinger, Cahone, Sturgis, Upperco, Highwood, Waipahu, Bowdon, Tyler, Watkins, Republic, Millville, Aguanga, Bowdon Junction, Morenci, South El Monte
Differences between regular expressions
And I've heard that there are some minor differences in regular expressions from one language to another (PHP, JavaScript, Perl, MySQL, Ruby, etc.). But I can't find a page that explains what those differences are. I could sit down and read the documentation for each language and cross-reference it, - but are there not a place where it has been summed up?
Addition: I come from the PHP-world, - and every time I write a regular expression in MySQL, there's a seed of doubt thinking: 'Is this one of those things that are different?'. Ideally I was looking for a place, where I could kill that doubt. Especially because it's so difficult to Google, because regular expressions are so punctuation-heavy.