关于正则表达式匹配的思考 [英] thoughts on regular expression matching

查看:82
本文介绍了关于正则表达式匹配的思考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩ICU库(周末慢:-)而且非常简单

来公开Unicode数据库的正则表达式功能。

假设大多数不是unicode,那么支持非Unicode unicode DB的ASCII的developerWorks

文章是否有用?

(否则我''我必须为翻译表做一些严肃的挖掘工作)


以下是我所拥有的一个例子:


- 验证加拿大邮政编码:

db2 =>值匹配(''L0H1H0'',''[AZ] [0-9] [AZ] [0-9] [AZ] [0-9]'');


1

------

1


1条记录被选中。


其他可能的功能是在这里听:
http ://icu.sourceforge.net/userguide/regexp.html


输入欢迎

Serge

- -

Serge Rielau

DB2解决方案开发

IBM多伦多实验室


IOD会议 http://www.ibm.com/software/data/ ond ... ness / conf2006 /

I''m playing with the ICU library (slow weekend :-) and it''s quite simple
to expose the regular expression functionality for Unicode databases.

Presuming that the majority is not on unicode, would a developerWorks
article which supports ASCII only for non unicode DBs be useful?
(Otherwise I''ll have to do some serious digging for translation tables)

Here is an example of what I''ve got:

-- validate Canadian postal code:
db2 => values matches(''L0H1H0'', ''[A-Z][0-9][A-Z][0-9][A-Z][0-9]'');

1
------
1

1 record(s) selected.

Other functions possible are listen here:
http://icu.sourceforge.net/userguide/regexp.html

Input welcome
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/

推荐答案

Serge Rielau写道:
Serge Rielau wrote:
我在玩使用ICU库(周末缓慢:-),显示Unicode数据库的正则表达式功能非常简单。假设大多数人不在unicode上,那么只支持非Unicode unicode数据库的ASCII文章是否有用?
(否则我将不得不做一些严肃的挖掘翻译表)

以下是我的例子:

- 验证加拿大邮政编码:
db2 =>值匹配(''L0H1H0'',''[AZ] [0-9] [AZ] [0-9] [AZ] [0-9]'');

1
------
1

1条记录被选中。

其他可能的功能都在这里听:
http://icu.sourceforge.net/userguide/regexp.html

输入欢迎
Serge
I''m playing with the ICU library (slow weekend :-) and it''s quite simple
to expose the regular expression functionality for Unicode databases.

Presuming that the majority is not on unicode, would a developerWorks
article which supports ASCII only for non unicode DBs be useful?
(Otherwise I''ll have to do some serious digging for translation tables)

Here is an example of what I''ve got:

-- validate Canadian postal code:
db2 => values matches(''L0H1H0'', ''[A-Z][0-9][A-Z][0-9][A-Z][0-9]'');

1
------
1

1 record(s) selected.

Other functions possible are listen here:
http://icu.sourceforge.net/userguide/regexp.html

Input welcome
Serge



确实如此。我想念DB2中的RE模式匹配。我一直在使用

v2 / sed / awk / perl太久了。我知道这要求太多了,但是要公开的函数包括PHP的ereg_replace吗?


It would indeed. I miss RE pattern matching in DB2. I''ve been using
v2/sed/awk/perl for too long. I know it is too much to ask for, but do
the functions exposed include anything like PHP''s ereg_replace?


Hello。


我认为在DB2中获取正则表达式功能的最简单方法是使用一些

java包(或使用内置的java 1.4功能)。

你必须使用这个包编写相当简单的java UDF来获得

匹配,组,替换正则表达式功能。

自DB2 v6以来我一直在这样做。 1.

套餐:

首先是IBM的regex4j.jar(没有替换功能),现在是

它是包来自 http://jregex.sourceforge.net


如果有人需要样品,请写在

mark(dot)b(at)mail(dot)ru


此致,

Mark B.
Hello.

I think the easiest way to get regex functionality in DB2 is using some
java package (or using built-in java 1.4 functionality).
You have to write fairly simple java UDFs using this package to get
match, group, replace regex functionality.
I have been doing so since DB2 v6.1.
Packages:
First of all it was IBM''s regex4j.jar (no replace functionality), now
it is package from http://jregex.sourceforge.net.

If someone needs samples, write at
mark(dot)b(at)mail(dot)ru

Sincerely,
Mark B.
确实如此。我想念DB2中的RE模式匹配。我一直在使用
v2 / sed / awk / perl太久了。我知道它要求太多了,但是暴露的功能包括像PHP的ereg_replace这样的东西吗?
It would indeed. I miss RE pattern matching in DB2. I''ve been using
v2/sed/awk/perl for too long. I know it is too much to ask for, but do
the functions exposed include anything like PHP''s ereg_replace?






Serge Rielau写道:
Serge Rielau wrote:
我正在玩ICU库(周末慢:-)并且很简单地公开正则表达式功能Unicode数据库。

假设大多数不是unicode,那么只支持非Unicode数据库的ASCII的developerWorks
文章会有用吗?
(否则我会有对翻译表进行一些认真的挖掘)

以下是我所拥有的一个例子:

- 验证加拿大邮政编码:
db2 = >值匹配(''L0H1H0'',''[AZ] [0-9] [AZ] [0-9] [AZ] [0-9]'');

1
------
1

1条记录被选中。

其他可能的功能都在这里听:
http://icu.sourceforge.net/userguide/regexp.html
I''m playing with the ICU library (slow weekend :-) and it''s quite simple
to expose the regular expression functionality for Unicode databases.

Presuming that the majority is not on unicode, would a developerWorks
article which supports ASCII only for non unicode DBs be useful?
(Otherwise I''ll have to do some serious digging for translation tables)

Here is an example of what I''ve got:

-- validate Canadian postal code:
db2 => values matches(''L0H1H0'', ''[A-Z][0-9][A-Z][0-9][A-Z][0-9]'');

1
------
1

1 record(s) selected.

Other functions possible are listen here:
http://icu.sourceforge.net/userguide/regexp.html




这里有一个正则表达式文章: http: //tinyurl.com/pyzto


它建立在C函数之上。然而,将它们带到Java和Unicode可能是一个很好的想法。


-

Knut Stolze

DB2信息集成开发

IBM德国



There is a regex-article here: http://tinyurl.com/pyzto

It builds on C function. Carrying them to Java and Unicode may be a good
idea, though.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


这篇关于关于正则表达式匹配的思考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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