📄 regexp.cpp
字号:
// $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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -