« Alternation and repetition Grouping » PHP Manual Pattern matching Anchors Anchors Anchors Sequence Description ^ Start of string or after a newline. $ End of string or before a newline.