プロが教えるわが家の防犯対策術!

VB6でperl互換の正規表現を使いたいのですが可能でしょうか?

A 回答 (2件)

perl互換つってもPerlのそれはバージョンによって結構違うんですけど、


どの辺の記述が使えればいいんですか?

この回答への補足

Perl5.8です。

バージョンごとに異なるとは知りませんでした。
例えば何が異なるのでしょうか?

補足日時:2008/06/28 09:05
    • good
    • 0

VB6から使える5.8レベルの正規表現を実装したDLLはないんじゃないかなあ。



ざっとまとめると

5.0から使える
*? Match 0 or more times, not greedily
+? Match 1 or more times, not greedily
?? Match 0 or 1 time, not greedily
{n}? Match exactly n times, not greedily
{n,}? Match at least n times, not greedily
{n,m}? Match at least n but not more than m times, not greedily

5.10から使える

*+ Match 0 or more times and give nothing back
++ Match 1 or more times and give nothing back
?+ Match 0 or 1 time and give nothing back
{n}+ Match exactly n times and give nothing back (redundant)
{n,}+ Match at least n times and give nothing back
{n,m}+ Match at least n but not more than m times and give nothing back



Character Classes and other Special Escapes
5.6か5.8あたりから
\pP Match P, named property. Use \p{Prop} for longer names.
\PP Match non-P
\X Match eXtended Unicode "combining character sequence",
equivalent to (?:\PM\pM*)
\C Match a single C char (octet) even under Unicode.
NOTE: breaks up characters into their UTF-8 bytes,
so you may end up with malformed pieces of UTF-8.
Unsupported in lookbehind.

5.6から?
\zMatch only at end of string

戻り読みは5.6から
(?<=pattern)
(?<!pattern)

こんなところ?
#あえて書き出さなかった違いもあります

よく使われるDLLに BREGEXP.DLLというのがありますが、これがサポートしているのは
5.003あたりのものです。

BREGEXP DLL
http://www.hi-ho.ne.jp/babaq/bregexp.html
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!