Im sure this has been posted before but I am having trouble locating an answer.
preg_match("/^[a-zA-Z0-9 -\.]{1,25}+$/i", ...
The regular expression above allows for all alphabetic characters, all numeric characters, and the following (,
-
,.
). It also limits whatever string we are checking against to max 25 characters total. What I cannot understand is the purpose of +$/i
. I can find most of those characters in documentation but do not understand why they are needed. The only one I cannot find any information on is i
.
Edit: I suppose the $
ties into our use of the ^
character?
Edit2: Thanks to comments below it seems the i
makes the expression case insensitive. Still looking for information in regards to the other characters.