Google is failing me because ?= is not searchable. What does
(?=[aeiouy])
match -- specifically ?=, I know that [aeiouy] is any of aeiouy.
Google is failing me because ?= is not searchable. What does
(?=[aeiouy])
match -- specifically ?=, I know that [aeiouy] is any of aeiouy.
?= is the positive lookahead syntax, it matches anything followed by a vowel here.
It matches any place where the next character is an a, e, i, o, u or y, but it doesn't match that character - see http://www.rubular.com/r/Tjq3ocLMVJ
Specifically, (?=...) is called a "lookahead" and it verifies that the following chunk is present
From MDC:
x(?=y)
Matches x only if x is followed by y.
For example, /Jack(?=Sprat)/ matches 'Jack' only if it is followed by 'Sprat'. /Jack(?=Sprat|Frost)/ matches 'Jack' only if it is followed by 'Sprat' or 'Frost'. However, neither 'Sprat' nor 'Frost' is part of the match results.
So:
foo(?=[aeiouy])
Would match fooe, fooi etc. but not foo alone, but as already stated in the quote, the vowel in this case will not be included in the match itself.
Let's say your string is "bbbbae", then "(?=[aeiouy])" matches either the 'a' or the 'e', when applied anywhere before 'a'.
b and a and between a and e, not just "anywhere before a".