pond2539 发表于 2017-5-9 06:49:17

Ruby速查 -- 匹配/查找字符串

ruby 代码

[*]/\d\d:\d\d:\d\d/     # a time such as 12:34:56   
[*]/Perl.*Python/       # Perl, zero or more other chars, then Python   
[*]/Perl Python/        # Perl, a space, and Python   
[*]/Perl *Python/       # Perl, zero or more spaces, and Python   
[*]/Perl +Python/       # Perl, one or more spaces, and Python   
[*]/Perl\s+Python/      # Perl, whitespace characters, then Python   
[*]/Ruby (Perl|Python)/ # Ruby, a space, and either Perl or Python   
页: [1]
查看完整版本: Ruby速查 -- 匹配/查找字符串