What does the $/i
mean in the following php code?
preg_match ('/^[A-Z \'.-]{2,20}$/i')
/
denotes the end of the pattern. The i
is a modifier that makes the pattern case-insensitive, and the $
anchor matches the end of the string.
the $
is an anchor -- it means the end of the string should be there. the /
is the end delimiter for the regular expression. The i
means that the regular expressions should be case-insensitive (notice that [A-Z \'.-]
only matches A-Z -- the i
means it doesn't have to look for a-z as well).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With