regexp.cpp

来自「这是个人脸识别程序」· C++ 代码 · 共 28 行

CPP
28
字号
// $mat\regexp.cpp 1.5 milbo$// Warning: this is raw research code -- expect it to be quite messy.#include <stdio.h>#include <string.h>//-----------------------------------------------------------------------------// User must make sure CompiledRegExp is big enoughbool fRegExpCompile (char *CompiledRegExp, const char *sRegExp)	// return 1 on success, 0 on failure{strcpy(CompiledRegExp, sRegExp);return 1;}//-----------------------------------------------------------------------------int iRegExpMatch (const char *s, const  char *CompiledRegExp)	// returns -1 on no match, else index of match in s{if (CompiledRegExp == NULL || CompiledRegExp[0] == 0)	return 0;		// everything matches a null regular expressionif (0 == strncmp(s, CompiledRegExp, strlen(CompiledRegExp)))	return 0;else	return -1;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?