background preloader

Expresso Regular Expression Development Tool

Expresso Regular Expression Development Tool

An Introduction to Regular Expression with VBScript By Scott Mitchell Introduction: Let me start out by saying that I am no expert when it comes to regular expression! I have used regular expression on only a few occasions, and that was when writing some small Perl utilities for my Linux box. I am by no means an expert in the field. However, I've decided that I'd like to improve my regular expression skills, so I started studying up, and have decided to document my education in the form of articles to help others who are interested in learning regular expression! Regular Expression's Roots: Regular expression use to be a thing that only UNIX users knew about. No, I don't want to hear any excuses that sound like, "I don't have the VBScript 5 Engine, so I don't need to learn regular expression." So What the Heck is Regular Expression? Regular expression allows you to quickly search (and replace, if you like) for strings within another string. Character Matching: Character matching is the easiest, so let's start there. Pretty neat, eh?

Joshua Flanagan - Readable Regular Expressions My main point of focus at work lately has been promoting maintainable code. One of the key tenets is readable code. The single responsibility principle and a low cyclomatic complexity are important, but if you are still using cryptic, prefixed, acronymed, and highly abbreviated identifiers, it is still going to be a chore for the reader to decipher. My slogan: "let's take the code out of source code". I was just listening to Roy Osherove talk about regular expressions on .NET Rocks. A recurring theme brought up was how hard regular expressions are to deal with. It got me thinking that this was a problem worth solving. Inspired by the Ayende's Rhino.Mocks syntax, I created a library that provides a better way to define regular expressions in your source code. Regex socialSecurityNumberCheck = new Regex(@"^\d{3}-? Using ReadableRex (not settled on the name yet...), it would look like: Regex socialSecurityNumberCheck = new Regex(Pattern.With.AtBeginning .Digit.Repeat.Exactly(3) .AtEnd);

You Don’t Know Anything About Regular Expressions: A Complete Guide Regular expressions can be scary...really scary. Fortunately, once you memorize what each symbol represents, the fear quickly subsides. If you fit the title of this article, there's much to learn! Let's get started. The key to learning how to effectively use regular expressions is to just take a day and memorize all of the symbols. . Yep - it's not fun, but just memorize them. You can be certain that you'll want to rip your hair out at one point or another when an expression doesn't work, no matter how much it should - or you think it should! The next step is to learn how to actually use these symbols! In this final section, we'll review a handful of the most important JavaScript methods for working with regular expressions. This one accepts a single string parameter and returns a boolean indicating whether or not a match has been found. Above, we begin by declaring a regular expression which only allows upper and lower case letters, an underscore, and a dash. Thanks for reading!

Related: