I'm using preg_match with PHP 5.6 to retrieve a value from a string. (I'm newb with preg_match)
It goes with this format:
data[SearchForm][somestringhere]
And I need to be able to retrieve the 'somestringhere' value.
I tried doing it this way:
$search_field_pattern = "/\bdata[SearchForm][[a-zA-Z]]\b/i";
if(preg_match($search_field_pattern, "foo")) {
debug('foobar!');
}
But it's not working. Can someone give me a hint why it's not working and what I should do to correctly approach this solution?
Thank you.