Rubular: a Ruby regular expression editor and tester

Rubular: a Ruby regular expression editor and tester

Regex quick reference

[abc]A single character of: a, b or c
[^abc]Any single character except: a, b, or c
[a-z]Any single character in the range a-z
[a-zA-Z]Any single character in the range a-z or A-Z
^Start of line
$End of line
\AStart of string
\zEnd of string
.Any single character
\sAny whitespace character
\SAny non-whitespace character
\dAny digit
\DAny non-digit
\wAny word character (letter, number, underscore)
\WAny non-word character
\bAny word boundary character
(...)Capture everything enclosed
(a|b)a or b
a?Zero or one of a
a*Zero or more of a
a+One or more of a
a{3}Exactly 3 of a
a{3,}3 or more of a
a{3,6}Between 3 and 6 of a

options:
i case insensitive
m make dot match newlines
x ignore whitespace in regex
o perform #{...} substitutions only once

For a complete Ruby regex guide, see the Pickaxe.

posted on 2012-08-02 16:19  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/08/02/2620237.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值