I need to get only these parts from the line below: Jony, Smith and example-free@wpdevelop.com
which, as you see, are between ^ and ~.
text^name1^Jony~text^secondname1^Smith~text^email1^example-free@wpdevelop.com~
for this i tried:
preg_match_all ('/\^(.*?)\~/', $row['form'], $res);
For the name it displays: ^ name1 ^ Jony ~
for the second name: ^ secondname1 ^ Smith ~
and email: ^ email1 ^ example-free@wpdevelop.com ~
As you can see, the word "text" has already disappeared, but not the name ^, name1, secondname1, email1 and ~
Can you tell me what is wrong in my regex?
source
share