Hello,
please check out this article on Regular Expressions.
Feedback welcome, always looking to improve
Hello,
please check out this article on Regular Expressions.
Feedback welcome, always looking to improve
Thanks for that!
2015-06-28 17:06 GMT+02:00 jesus <matugm@gmail.com>:
Hello,
please check out this article on Regular Expressions.Regular Expressions in Ruby - BlackBytes
Feedback welcome, always looking to improve
Jesus,
Hello,
please check out this article on Regular Expressions.Regular Expressions in Ruby - BlackBytes
Feedback welcome, always looking to improve
this is a nice-looking, good-written easy article that covers the basics of
regular expressions in Ruby, and a bit beyond. Good work!
I wouldn't, however, call it "Mastering Ruby Regular Expressions", because
after reading this article, one is still a far bit away from mastery. Anchors,
for example, are missing from the article completely, let alone the "\A \Z vs.
^ $" caveat that recently caused a bug [1, 2]. Also, you show how to accept
something that resembles an IPv4 address, mention that it would also accept
invalid IPv4 addresses, but do not offer an alternative. I.e., although
regular expressions are a mighty weapon, they have limits. Why not outlining
them and giving the reader access to alternatives?
You begin to cover look-ahead and look-behind, without giving good examples
for applications. There's also no notion of sub-expression calls, or other
advanced features. Perhaps you'd like to extend the article into a series?
That would be nice! For example, regular expressions can be used to parse
HTML, even though it is isn't regular [3].
Also, how we construct our expression makes a huge difference [4]. We're also
used to parse numbers or generally, characteres from the US-ASCII range ---
but how do we match other characters, like Kanji? Name validation can be
tough! Another interesting topic are credit card numbers, which can be matched
just nicely with a basic regular expression, but cannot tested for correctess
--- unless you embed code in your regular expression to employ the Luhn
algorithm [5].
Phew, glancing back, there's a lot of seemingly negative feedback in this e-
mail. Except, it isnt---because, please don't get me wrong: I enjoyed reading
your article! I hope that there it is the beginning of a "Mastering Ruby
Regular Expressions, Pt. 2, 3, 4..." series that covers all these nice real-
world applications for regular expressions in Ruby. I'm looking forward to it!
--- Eric
[1] Mongo BSON Injection: Ruby Regexps Strike Again
[2] Egor Homakov: Injects in Various Ruby Websites Through Regexp.
[3] The true power of regular expressions
[4] Regexes: the Bad, the Better, and the Best
[5] Luhn algorithm - Wikipedia
On Sunday 28 June 2015, 17:06:38, jesus wrote:
jesus,
On 2015-06-29 01:06, jesus wrote:
Hello,
please check out this article on Regular Expressions.Regular Expressions in Ruby - BlackBytes
Feedback welcome, always looking to improve
Nice! Thanks for that!
P.
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au
I agree - well done, and attractive to the eye. ~t
On Sun, Jun 28, 2015 at 11:19 PM, Philip Rhoades <phil@pricom.com.au> wrote:
jesus,
On 2015-06-29 01:06, jesus wrote:
Hello,
please check out this article on Regular Expressions.Regular Expressions in Ruby - BlackBytes
Feedback welcome, always looking to improve
Nice! Thanks for that!
P.
--
Philip RhoadesPO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"I don't want to get to the end of my life and find that I lived just the
length of it. I want to have lived the width of it as well." --Diane
Ackerman
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA LMHC (WA)
Psychotherapist (psychological trauma, dissociative disorders)
Spokane, Washington, U.S.A: (435) 272-3332
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~