Reputation: 109
I have a collection of strings and want to filter out those where the last four characters are: (alpha)(alpha)(number)(number).
I know I can make a substring of each of these and separately, but what is the method to determine the types of the characters in the sequence?
This is for SQL in Hive.
Upvotes: 0
Views: 37
Reputation: 1270873
You can use regular expressions. Something like:
where col regexp '[a-zA-Z]{2}[0-9]{2}$'
Upvotes: 1