Get updates

Regular Expressions

Scott JavaScript RegExp Tool Available

There are times when I just need to process some text quickly and efficiently. Regular Expressions are very well suited to this task, and now I’ve released my own JavaScript Regular Expressions tool for just this purpose.

Continue Reading…

Scott Extending JavaScript Strings with Chomp using Prototypes

Chomp is that oh-so-fun function in Perl to bite off extra newlines from the end of a string. It can be useful to have chomp for JavaScript too, especially in cases such as reading input in textareas.

This time around, I’m going to take a quick look at how we can take the standalone JavaScript chomp function and make it even more accessible by extending JavaScript’s String object, which also gives us an excuse to try out the awesome prototype feature in JavaScript.

Continue Reading…

Scott Introduction to Regular Expressions in JavaScript: Alternation and Grouping

Regular expressions provide lots of flexibility in processing text, and this article introduces two additional metacharacters (three counting both parentheses), but first I’ll start with a summary of what was covered in the previous regex article:

Continue Reading…

Scott Introduction to Regular Expressions in JavaScript

If you’re a programmer who has ever had to develop an application dealing with text input (which is most of them), from files, databases, or user input, you might be interested to know that regular expressions can make your job a lot easier.

Unlike most dry regular expressions tutorials out there (Mike’s smart post aside), I intend to provide more than just the “what”; I’ll walk you through the “how” and “why” too. After all, why would you care to learn regular expressions if you don’t get to find out about some of the cool and powerful things you can do with them?

Continue Reading…

Scott Chomp for JavaScript

In most programming languages, there exist certain simple and useful functions that people come to rely upon. From my days with Perl, chomp was one of those functions for me.

Given a string, chomp bit off all newline characters at the end of the string (and returned the number of newline characters it removed).

Continue Reading…

3DM Design is where Scott Drake publishes thoughts on programming web applications in JavaScript and Ruby.