POSIX 兼容的 Visual Studio C 正则表达式库 [英] POSIX-compatible regex library for Visual Studio C

查看:63
本文介绍了POSIX 兼容的 Visual Studio C 正则表达式库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将在 Linux 和 Visual Studio 2010 中运行的 C 程序,我正在寻找一个正则表达式库.GNU 带有兼容 POSIX 的正则表达式库,但 Visual Studio 尽管有 C++ std::regex,却没有兼容 C 的库.GNU 有其库的 Windows 版本 (http://gnuwin32.sourceforge.net/packages/regex.htm),但 DLL 仅为 32 位且源代码无法在 Visual Studio 中编译(约 500 个错误!).我唯一的要求是最终用户不必安装任何额外的东西,并且应该在两个平台上获得相同的行为.我不挑剔它是 POSIX 风格、Perl 风格还是别的什么.我应该怎么办?提前致谢.

I'm working on a C program which will be run in Linux and from inside Visual Studio 2010, and I'm looking for a regex library. GNU comes with a POSIX-compatible regex library, but Visual Studio, despite having C++ std::regex, doesn't have a C-compatible library. GNU has a Windows version of their library (http://gnuwin32.sourceforge.net/packages/regex.htm), but the DLLs are 32-bit only and the source code can't compile in Visual Studio (~500 errors!). My only requirement is that the end-user should not have to install anything extra, and should get the same behaviour on both platforms. I'm not picky about whether it's POSIX-style, Perl-style or something else. What should I do? Thanks in advance.

推荐答案

我发现的一个编译基本不费力,也是最小的库是:https://code.google.com/p/slre/.这是非常基本的,但对于我的目的来说已经足够了.不过还是谢谢你的帮助.

The one library I've found that compiles with basically no effort, and is also the smallest, is: https://code.google.com/p/slre/. It's pretty basic but is good enough for my purposes. Thanks for the help, though.

这篇关于POSIX 兼容的 Visual Studio C 正则表达式库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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