I have the following code that I am trying to port over to NETMF:
$split = explode(' ', $output['observation_time_rfc822']);
$pnp = array(
'TZ' => '-\b[0-9]{4}\b$',
'D' => '([1-3][0-9]|[1-9])$',
'M' => '[A-Z][a-z][a-z]$',
'Y' => '\b[0-9]{4}\b$',
'T' => '[0-9][0-9]:[0-5][0-9]:[0-5][0-9]$',
);
foreach ($pnp as $put=>$pattern)
{
foreach ($split as $param)
{
if (preg_match('/'.$pattern.'/', $param))
{
$pnp[$put] = $param;
break;
}
}
}
Basically, this code takes a time that conforms to RFC822 and splits it into parts. Although the time is suppose to conform" to RFC822, it sometimes doesn’t, which would create a problem if I just split it and got the values in order.
So, My issue is that .NETMF doesn’t seem to have any implementation of RegExp (or any other pattern matching library for that matter), which this obviously requires.
Any ideas?