C ++:我应该使用什么正则表达式库? [英] C++: what regex library should I use?

查看:298
本文介绍了C ++:我应该使用什么正则表达式库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个在基于linux的系统上运行的商业(非开源)C ++项目。我需要在C ++代码中做一些正则表达式。 (我知道:我现在有2个问题。)



问题:从C / C ++经常做正则表达式的人们建议我调查哪些库?快速搜索引起了我的注意:



1)Boost.Regex(我需要去阅读Boost软件许可证,但这个问题不是关于软件许可证)



2)C(非C ++)POSIX regex(#include< regex.h>,regcomp,regexec等)



3) http://freshmeat.net/projects/cpp_regex/ (我一无所知一个;似乎是GPL,因此在这个项目不可用)

解决方案

感谢所有的建议。 b
$ b

我今天尝试了一些东西,我们试图做的东西,我选择了最简单的解决方案,我不必下载任何其他第三方库。最后,我#include< regex.h>并使用标准C POSIX调用regcomp()和regexec()。不是C ++,但在一个捏,这被证明是最简单的。


I'm working on a commercial (not open source) C++ project that runs on a linux-based system. I need to do some regex within the C++ code. (I know: I now have 2 problems.)

QUESTION: What libraries do people who regularly do regex from C/C++ recommend I look into? A quick search has brought the following to my attention:

1) Boost.Regex (I need to go read the Boost Software License, but this question is not about software licenses)

2) C (not C++) POSIX regex (#include <regex.h>, regcomp, regexec, etc.)

3) http://freshmeat.net/projects/cpp_regex/ (I know nothing about this one; seems to be GPL, therefore not usable on this project)

解决方案

Thanks for all the suggestions.

I tried out a few things today, and with the stuff we're trying to do, I opted for the simplest solution where I don't have to download any other 3rd-party library. In the end, I #include <regex.h> and used the standard C POSIX calls regcomp() and regexec(). Not C++, but in a pinch this proved to be the easiest.

这篇关于C ++:我应该使用什么正则表达式库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆