Incompatible with 1.9, as far as we know. Technically, it supports
everything current RegExp does.
SYNOPSIS:
Password = TextualRegexp.new do
anchor :beginning
group :capture do
any :letter
repeat(4…13) do
any :char
end
any :digit
end
end
Or the ever-loved email address…
Email = TextualRegexp.new do
anchor :beginning
group :capture do
at_least_once { any "a-z" + "0-9" + "_" + "." }
end
literal "@"
group :capture do
repeat(1..4) do
at_least_once { any "a-z" + "0-9" + "_" }
literal "."
end
any %w{com edu org co.uk com.au}
end
Interesting.
I’ll try it later today!
Maybe this will cut down on always looking up RegEx rules and
avoiding RegExes as much as possible!!
On first glance, it seems a bit verbose, but I’ll give it a try in
TextMate. (you might consider creating a TM Bundle for it, pretty
easy to do. And since E-Text Editor for windows uses TM Bundles as
well, it could be useful! Concise typing with Human Readable Content!!)
Glad you guys took the initiative from that thread a few weeks ago!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.