⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (261 Bytes)
Misc #9801
ยป regexp-extended-whitespace.rb
allolex (Damon Davison)
, 05/03/2014 02:47 PM
#!/usr/bin/env ruby
text
=
'Expect the regex to match this'
[
'match this'
,
'match\ this'
,
'match[ ]this'
,
Regexp
.
quote
(
'match this'
)
].
each
do
|
pattern
|
re
=
Regexp
.
new
(
pattern
,
Regexp
::
EXTENDED
)
puts
pattern
.
inspect
puts
(
re
===
text
).
to_s
end
(1-1/1)
Loading...