<?php $str = "Business Rule X0000-005 - The XML data has failed schema validation. cvc-maxInclusive-valid. Value '3144' is not facet-valid with respect to maxInclusive '2500' for type '#AnonType_StudentLoanInterestDedAmtIRS1040Type'. Field/Xpath:/efile:Return[1]/efile:ReturnData[1]/efile:IRS1040[1]/efile:StudentLoanInterestDedAmt["; $nonxmlbusrules_short = '/(?:Rule[\s])([a-zA-Z][0-9a-zA-Z]*[\-][0-9a-zA-Z]*)/'; $allbusrules = '/((?:Rule[\s])([a-zA-Z]{3}|[a-zA-z]{2}[0-9]{1})*[\-][0-9]*([-0-9]*)?)/'; $xmlbusrules = '/(X0000-005)/'; $nonxmlbusrules_long = '/(?:Rule[\s])([0-9a-zA-Z]*[\-][0-9a-zA-Z]*([\-][0-9a-zA-Z]*)?([-0-9]*)?)/'; $xpath_matcher = '/(?:Field\/Xpath:)[\s]*(.*)/'; // Match non-xml short business rules preg_match_all($nonxmlbusrules_short, $str, $matches[1]); $busRules_arr_short = $matches; // Match all business rules according to the pattern preg_match_all($allbusrules, $str, $matches[1]); $busRules_arr = $matches; // Match xml business rules and merge them into the all-rules preg_match_all($xmlbusrules, $str, $matches); $busRules_arr=array_merge($busRules_arr,$matches[1]); // Match non-XML long business rules and merge them into the all-rules preg_match_all($nonxmlbusrules_long, $str, $matches); $busRules_arr = array_merge($busRules_arr,$matches[1]); preg_match_all($xpath_matcher, $str, $matches); $xPath_arr = $matches[1]; $xPath_arr = preg_replace("(\[.*?\])", '', $xPath_arr); $xPath_arr = preg_replace("(\[*?)", '', $xPath_arr); foreach ($busRules_arr as $idx => $brule) { if (trim(strtolower($brule)) =='x0000-005') { echo "ITS AN XML RULE!"; }} print_r($busRules_arr[1]); print_r($xPath_arr);
You have javascript disabled. You will not be able to edit any code.