Simple question like. What does the regular "a^b" mean and is it possible to find it in any string?
import re p = re.compile("a^b") p.search("ab") --> None p.search("a^b") --> None p.search("a\nb") --> None If such an expression really doesn’t match any string (really, how can the character a occur before the beginning of the string being checked), then why does it compile at all?
Or, to paraphrase, does the meaning of the symbol ^ / $ change depending on its position in the regular expression (not inside the square brackets)? If not, why not?
The question is irrelevant, the python is just an example of sake.