Reputation: 15692
... i.e. NOT to match "end of line".
$ in PHP matches "end of line". This includes when you have the "m" flag.
But what if you have a multi-line string and you want to match the very end of it (or for that matter the very beginning)
I've done quite a bit of searching before daring to pose this question: searched the regex FAQ at SO, etc. Also studied quite carefully the functioning of the various PHP regex modifiers here. In particular, on that page, I thought I had found the answer with the "D" modifier: "If this modifier is set, a dollar metacharacter in the pattern matches only at the end of the subject string... ".
But ... if you read further in that para it then says: "This modifier is ignored if m modifier is set." (the "m" modifier is the "multi-line" modifier).
So... I'm confused, flummoxed, etc. '/Help!/'
Upvotes: 1
Views: 203