Meta character for 'Inverse' and 'or' in this certain problem using Regular Expression | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Meta character for 'Inverse' and 'or' in this certain problem using Regular Expression

Problem: Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates. In Oracle use REGEXP_LIKE function: This solution works fine but I want to solve it with one RegExp: 1.SELECT DISTINCT CITY FROM STATION WHERE NOT REGEXP_LIKE(CITY, '^[AEIOU]') OR NOT REGEXP_LIKE(CITY,'[aeiou]

#x27;); 2.SELECT DISTINCT city FROM station WHERE NOT REGEXP_LIKE(city,'^[AEIOU].*[aeiou]
#x27;); // 👆 My question1: Without using 'NOT' and 'OR' operator of SQL can't we use any inverse metacharacter in Regular Expression? RegEx[ not(A and B) ] = RegEx [not(A) or not(B) ] See the output of this to be more specific 👇 https://code.sol https://code.sololearn.com/WzGF3KRsC2B7/?ref=app Problem: https://www.hackerrank.com/challenges/weather-observation-station-11

10th Nov 2019, 2:23 PM
Sayan Kundu
2 Answers
+ 1
sorry I saw this post the other day and noticed it still has no reply. I am unsure if regex has what you've described. it would be handy. is this an exercise question being asked because there definitely is a way to do it or are you just asking out of curiosity?
12th Nov 2019, 9:23 PM
Nathan Stanley
Nathan Stanley - avatar
0
Nathan Stanley yes, I am curious. I am newbie in Regular expressions and trying to solve the problem in different ways to explore whats possible or not with RegExp.
16th Nov 2019, 9:42 AM
Sayan Kundu