Rust, 117117 91 bytes
Or 118 if we count 'y'Requires inputs to be lowercased and it might break horrendously on multibyte characters as a vowelper the challenge's allowances. Officially only supports single-byte character input.
|s:&str|s.to_lowercase().split(' ').any(|w|w.starts_with("ill")&&w.chars&&()w.nthlen(3).is_none_or(|c|<4||!"aiou""aiouy".contains(c&w[3..4])))
Ungolfed and explained:
// Non-regex answer; unless depending on flavor-specific behavior, there's two
// there's two regex answers already, they're just tagged as JS (ES6)
fn sick(album: &str) -> bool {
// Rely on implicit returns
album.to_lowercase() // explains itself
.split(' ') // split on literal space and iterate over the words
.any(|word|{ // Check if any of the splits matchesmatch a predicate function
word.starts_with("ill") // explains itself
&& (
word.charslen()<4 // iterate"ill" overis the charswhole thatword, makesick
up // OR the stringtitle does not match the pattern of false positives
|| !"aiouy".nthcontains(3&w[3..4]) // getso theit's charactersick
with 0-based index 3 // Rust doesn't allow byte indexing of strings, ifas itsome existsindices
.is_none_or( // If themay charnot doesbe notwhole existcharacters, the wordit *is*does ill
allow indexing ranges
// OtherwiseSo wethis returnis theeffectively result&w[3], ofbut ait checkingpanics function
if the char at
|c|!"aiou".contains(c) // non-ethis vowelposition checkhappens to skipbe falsemore positives
than one byte long
)
})
}