Different colo(u)rs

Report a typo

Some words are spelled differently in American and British English. Using special characters, create a regular expression color that fits four options: "color", "colour", "colors", and "colours".

Tip: Your task is to make a regex that suits the situation best. Don't try to write a universal pattern: use the characters . and ?.

Sample Input 1:

color

Sample Output 1:

true

Sample Input 2:

colooors

Sample Output 2:

false
Write a program in Kotlin
val color = TODO()
___

Create a free account to access the full topic