what is the meaning of the "~" in regex .For example in this code
preg_match("~^(\(\d+\)|\d+\-)?\d{10,20}$~",$value)
this code check for wether the phone number contains extension or not. I have tried to remove to the "~" in this code and got an error like this:
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in C:\xampp\htdocs\test\my_application\Phone.php on line 21
This character is called Tilde and in this case is simply a placeholder, it's just being used as a delimiter. It is simply delimiting the start and end of your regex pattern.
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