library/src/utility/BP-StringUtilities.cc
// perl compatible regular expression match info display routine.
//BP_DisplayRegexMatchInfoPCRE
perl compatible regular expression match info display routine.
perl compatible regular expression match info display routine .
BP_ERROR_T BP_DisplayRegexMatchInfoPCRE(P_BP_REGEX_MATCH_INFO match_info)
{
	if(!match_info)
		return ERR_FAILURE;
	if(!match_info->pcre_enabled)
		return ERR_FAILURE;
	if(!match_info->pcre_num_matched)
		return ERR_FAILURE;
	printf("\n [+] PCRE Match for %p: Indexes relative to start of string.", match_info);
	size_t i = 0;
	for(i = 0; i < match_info->pcre_num_matched; i++)
	{
		printf("\n\t -> Match #%u:", i);
		printf("\n\t      Start Byte Index: %u", match_info->preg_matches[i].match_index);
		printf("\n\t      Match Length:     %u", match_info->preg_matches[i].match_len);
		if(match_info->preg_matches[i].matched_string)
			printf("\n\t      Match Length:     %s", match_info->preg_matches[i].matched_string);
	}
	return ERR_FAILURE;
}
BP_ERROR_T BP_DisplayRegexMatchInfoPCRE ( P_BP_REGEX_MATCH_INFO match_info ) { if ( ! match_info ) return ERR_FAILURE ; if ( ! match_info -> pcre_enabled ) return ERR_FAILURE ; if ( ! match_info -> pcre_num_matched ) return ERR_FAILURE ; printf ( " \n " , match_info ) ; size_t i = 0 ; for ( i = 0 ; i < match_info -> pcre_num_matched ; i ++ ) { printf ( " \n \t " , i ) ; printf ( " \n \t " , match_info -> preg_matches [ i ] . match_index ) ; printf ( " \n \t " , match_info -> preg_matches [ i ] . match_len ) ; if ( match_info -> preg_matches [ i ] . matched_string ) printf ( " \n \t " , match_info -> preg_matches [ i ] . matched_string ) ; } return ERR_FAILURE ; }
perl compatible regular expression match info display routine.
perl compatible regular expression match info display routine .
// walk arrays and display match content // return indicating no match