[源代码] 能在 DOS, Windows, Linux 下使用的正则表达式引擎

低调的小青蛙 2006-10-24 01:03:23
使用最方便的正则表达式引擎。不需要任何配置,只需要 include 一个头文件就可以使用了。

兼容性很好。可以在 Turbo C++ 3.0(DOS), Visual C++ 6, 7, 8(Windows), gcc(Linux, Cygwin) 等环境下进行编译。

支持多种复杂的表达式语法。除了支持基本的表达式语法外,还支持 "命名分组", "条件表达式", "递归表达式" 等高级语法。

国人开发,可下载源代码:
http://www.regexlab.com/deelx/

关注者有分,有任何问题或者想法,可用中文来信
...全文
977 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
gloomy_you 2006-11-05
  • 打赏
  • 举报
回复
学习学习~~~~
lllxy 2006-10-27
  • 打赏
  • 举报
回复
低调的小青蛙 2006-10-26
  • 打赏
  • 举报
回复
To idealguy(理想主义分子) 兄:

UEdit 的表达式与 Perl 的表达式语法是不同的,
DEELX 支持的是 Perl 的表达式语法

从我看你列出来的语法来说,DEELX 支持的 Perl 正则语法应该还要灵活一些。
不过常用的功能基本上都有,只是语法不同
突击召唤师 2006-10-25
  • 打赏
  • 举报
回复
我更关心可靠性。boost经过千锤百炼,我可以放心使用。一个新的库,有些担心也难免吧。
idealguy 2006-10-25
  • 打赏
  • 举报
回复
和Uedit32 的正则表达式(如下)比较如何?

Regular Expressions (UltraEdit Syntax):

Symbol Function
% Matches the start of line - Indicates the search string must be at the beginning of a line but does not include any line terminator characters in the resulting string selected.
$ Matches the end of line - Indicates the search string must be at the end of line but does not include any line terminator characters in the resulting string selected.
? Matches any single character except newline
* Matches any number of occurrences of any character except newline
+ Matches one or more of the preceding character/expression. At least one occurrence of the character must be found.
++ Matches the preceding character/expression zero or more times.
^b Matches a page break
^p Matches a newline(paragraph)
^t Matches a tab character
[ ] Matches any single character, or range in the brackets
^{A^}^{B^} Matches expression A OR B
^ Overrides the following regular expression character
^(區) Brackets or tags an expression to use in the replace command. A regular expression may have up to 9 tagged expressions, numbered according to their order in the regular expression. The corresponding replacement expression is ^x, for x in the range 1-9. Example: If ^(h*o^) ^(f*s^) matches "hello folks", ^2 ^1 would replace it with "folks hello".
Note - ^ refers to the character '^' NOT Control Key + value.

Examples:
m?n matches "man", "men", "min" but not "moon".

t*t matches "test", "tonight" and "tea time" (the "tea t" portion) but not "tea
time" (newline between "tea " and "time").

Te+st matches "test", "teest", "teeeest" etc. but does not match "tst".

[aeiou] matches every lowercase vowel
[,.?] matches a literal ",", "." or "?".
[0-9, a-z] matches any digit, or lowercase letter
[~0-9] matches any character except a digit (~ means NOT the following)

You may search for an expression A or B as follow:

"^{John^}^{Tom^}


This will search for an occurrence of John or Tom. There should be nothing between the two expressions.

You may combine A or B and C or D in the same search as follows:

"^{John^}^{Tom^} ^{Smith^}^{Jones^}"

This will search for John or Tom followed by Smith or Jones.

低调的小青蛙 2006-10-25
  • 打赏
  • 举报
回复
选择 boost 是没有错的,不过 boost 能够编译的环境并不一定比 DEELX 多,
DEELX 的易用性这一点,在某些场合也许你刚好用得上,因此不妨 "顺便关注" 一下。

DEELX 可以支持 UNICODE,因为使用模板编写,只要使用 wchar_t 作为基类型就可以了,不过不是完全意义上的 UNICODE。
bluesen 2006-10-24
  • 打赏
  • 举报
回复
我上去看看
OOPhaisky 2006-10-24
  • 打赏
  • 举报
回复
关注+支持,潜力贴!
mekiss 2006-10-24
  • 打赏
  • 举报
回复
看下
rickerliang 2006-10-24
  • 打赏
  • 举报
回复
更关注是否支持unicode
adintr 2006-10-24
  • 打赏
  • 举报
回复
支持 unicode 么?
「已注销」 2006-10-24
  • 打赏
  • 举报
回复
关注~~~
不过觉得BOOST库可能更好
wshcdr 2006-10-24
  • 打赏
  • 举报
回复
偶就知道boost
低调的小青蛙 2006-10-24
  • 打赏
  • 举报
回复
DEELX 不能用于 C

要在 C 下使用,可用前面的大虾所说的 <regex.h>
wtogether 2006-10-24
  • 打赏
  • 举报
回复
有C的没有
低调的小青蛙 2006-10-24
  • 打赏
  • 举报
回复
让大虾们见笑了,

其实我并不是要强调 DEELX 在 Turbo C++ 3.0 (DOS) 下发挥多大用处,
我只是想说明 DEELX 采用 "纯C++" 编写,尽可能不依赖编译器,不依赖操作系统,

正常用 Visual C++ 开发当然选择 boost 等成熟的引擎,
但 DEELX 的易用性这一点,在某些场合也许你刚好用得上,因此不妨 "顺便关注" 一下。

另外,
DEELX 在 "反向预搜索(反向令宽度断言)" 上有独到的理解。
DEELX 对递归表达式,命名分组的支持,在 C++ 环境下,也许有用得上的地方。
jixingzhong 2006-10-24
  • 打赏
  • 举报
回复
关注 ~

看看算法什么的,
使用的话,
boost 显然首选 ~

不过,
私底下也可以试试感觉如何 ·
sinall 2006-10-24
  • 打赏
  • 举报
回复
楼上太冷了,眼神好飘忽啊……^_^
“…… gcc(Linux, Cygwin) 等环境下进行编译。”
低调的小青蛙 2006-10-24
  • 打赏
  • 举报
回复
"不知道这个工具将来是否会出Linux版本" 这个想法不错哦,

不过要在 Linux 下开发 UI,可能得要重头学,不太好办,只有慢慢考虑了,短期内恐怕搞不定
pcboyxhy 2006-10-24
  • 打赏
  • 举报
回复
正则表达式编写工具软件
我正好有这个需要
很想试试
可是我只有Linux系统

不知道这个工具将来是否会出Linux版本
加载更多回复(11)

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧