やりたいことはperlで言うとこの以下の内容。
use strict;
use warnings;
use utf8;
use Encode;
sub debug{ print encode("shiftjis", (join "", @_)) }; #winOSコマンドプロンプト用
$_ = "ab_CD_ef_GH";
while(m/[a-z]+/g){
debug($&, "\n");
}
debug("-----------\n");
while(m/[a-z]+/ig){
debug($&, "\n");
}
Imports System.Text.RegularExpressions
Module Module1
Sub Main()
Dim str As String = "ab_CD_ef_GH"
Dim reg As New Regex("[a-z]+")
Dim match As Match = reg.Match(str)
While match.Success
Console.WriteLine(match.Value)
match = match.NextMatch()
End While
Console.WriteLine("-----------")
reg = New Regex("[a-z]+", RegexOptions.IgnoreCase)
match = reg.Match(str)
While match.Success
Console.WriteLine(match.Value)
match = match.NextMatch()
End While
End Sub
End Module
0 件のコメント:
コメントを投稿