I would like to store the interface name only. So in this case, I would like to store Interface900. Below is my code. Can't seem to figure out how to do this.
$str = '[TIMETRA-VRTR-MIB::vRtrIfName.22.178] => STRING: "interface900" ';
preg_match_all("!^STRING: \"?(.*?)\"?$!", $str, $matches))
print_r($matches);
Also tried
preg_match_all('(STRING: ")([\w-_]*)', $str, $matches);
print_r($matches);
IN both cases, it's not printing Interface900. I'm not too good with regex or php. Can someone help me please?
Your RegEx is incorrect, it should be:
Example
Why your RegEx failed