1 Star 0 Fork 0

fangxlmr/frex

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
frex.c 403 Bytes
一键复制 编辑 原始数据 按行查看 历史
fangxlmr 提交于 2018-08-07 10:42 . mainly refactor parser
#include <stdio.h>
#include "parser.h"
#include "ast2nfa.h"
#include "match.h"
int main()
{
AST *ast;
NFA *nfa;
char *re = "a(b|c|d)*\\**";
char *str = "abbbcccbcbcbbcdbcbdcdd******";
ast = re2ast(re);
nfa = ast2nfa(ast);
if (match(nfa, str) != 0) {
printf("Match.\n");
} else {
printf("Not match.\n");
}
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/fangxlmr/frex.git
git@gitee.com:fangxlmr/frex.git
fangxlmr
frex
frex
master

搜索帮助