php - Difference between # and / in preg_replace function for pattern parameter? -



php - Difference between # and / in preg_replace function for pattern parameter? -

what # sign differently /?

$output = preg_replace('#[^a-za-z0-9]#i', '', $input); $output = preg_replace('/[^a-za-z0-9]/i', '', $input);

and letter after /[^a-za-z0-9]/?

also ^ mean?

in languages, not matter type of character starts or ends pattern portion of regular expression, long same @ origin , end (i believe holdover perl, arguably first great regex language). since php follows line of thought, # , / equivalent.

i = "make search case insensitive" [^...] = exclude between square brackets (^ means "exclusion" in context).

you can larn lot regular expressions here.

php preg-replace

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -