Forum Moderators: phranque

Message Too Old, No Replies

pattern modifiers confusion

\A \ m \D \J \S

         

phparion

9:12 pm on Mar 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi

I was studying the PCRE manual. I am confused with the definition and its practice usage of following pattern modifiers

\A - Anchored

\m - multiline

\D - dollar_only
\J - info_jchanged
\S

I am mostly clear about the use of \m that it starts to read the newline character, without it whole string including newline characters are considered as a single character but i am confused about this line from the manual

"The "start of line" metacharacter (^) matches only at the start of the string, while the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (unless D modifier is set)"

Also are \D and \m equivalent or different in behavior? I failed to find any practical examples of these modifiers and would really appreciate if anybody could help me understand their usage.

Thank you very much!