Today, I have read a question on Stack Overflow, at here: https://stackoverflow.com/questions/32151810/how-to-parse-this-text-block-into-variables-by-php
I have tried to do it with this code:
preg_match("/([a-zA-Z_]+)/", "[first_text] = [second_text, third_text] : [forth_text, fifth_text]", $matches);
When I tested it, it didn't work correctly:
echo $matches[0];
echo $matches[1];
echo $matches[2];
echo $matches[3];
echo $matches[4];
Will print:
first_textfirst_text
What is the error in my own PHP regex code?