

except you define exactly what characters can be matched. You can think of it as like using the dot. Sets allow you to match against a set of characters that you enclose between brackets. m: This makes the searching multiline instead of a single line.o: This evaluates the expression only once.g: This makes the searching global which prevents it from stopping after the first match.


Here's a list of all the meta characters you can use in your PHP regular expressions. Notice how even though our pattern read t.aste that it was still able to match the string taste? The. character will match any single character: 1 Meta characters are characters that can be used in our regular expressions that have special meaning to them.įor example, a dot. Our search patterns can utilize meta characters. Regular expressions aren't limited to just straight text.
