Quantcast
Channel: Staffan Nöteberg's blog » Javascript
Browsing latest articles
Browse All 10 View Live

Image may be NSFW.
Clik here to view.

Regular Expression Concatenation

Using Rule number 2 and Rule number 4, we can create regular expressions that consists of any sequence of symbols from our alphabet. Rule number 2 said that if the symbol a is in the alphabet, then a...

View Article



Image may be NSFW.
Clik here to view.

Regular Expression Alternation

From rule number 2 and rule number 3 we can define paradigms — a number of possible patterns. This means that we add two or more languages by applying the set operator union to them. The union of the...

View Article

Image may be NSFW.
Clik here to view.

The Kleene Star operator

All finite languages ​​can be described by regular expressions. You can simply list the strings as an alternation string1|string2|string3 etc. But there are also some languages with an infinite number...

View Article

Image may be NSFW.
Clik here to view.

Regular Expression Precedence

You might be tempted to read the following regular expression as third or fifth row: 'fifth row'.match /third|fifth row/ #=> #<MatchData "fifth row"> 'third row'.match /third|fifth row/...

View Article

Image may be NSFW.
Clik here to view.

Simple Regular Expression Examples

Now, we have three operators and a small framework. After all this theory, you might wonder if it’s possible for us to solve any problems. Yes, of course we can. Here are some examples: All binary...

View Article


Image may be NSFW.
Clik here to view.

From Regular Expression to Finite Automaton

For each regular expression — and I mean the three operators and the six recursive rules style — there is a finite automaton that accepts exactly the same strings. Since this is not a university book...

View Article

Image may be NSFW.
Clik here to view.

The Scent of Regex Requisite

Did you know that the famous quote “Some people, when confronted with a problem, think: I know, I’ll use regular expressions. Now they have two problems.” dates all the way back to 1997? However, most...

View Article

Image may be NSFW.
Clik here to view.

HTML5 Form Validation With Regex

Client side validation has always been a potential headache for front-end programmers. Embedded blocks with a mixture of imperative JavaScript and declarative regex can be a mess. HTML5 has ambition...

View Article


Image may be NSFW.
Clik here to view.

Regular Expressions – a brief history

Regular Expressions is a programming language with which we can specify a set of strings. With the help of two operators and one function, we can be more concise than if we would have to list all the...

View Article


Image may be NSFW.
Clik here to view.

Dot — The Regex Barbapapa

Remember Barbapapa — Annette Tison’s and Talus Taylor’s children’s books and films from the 1970s? The hero was a pink, pear-shaped guy with the ability to take on almost any shape whatsoever. The...

View Article
Browsing latest articles
Browse All 10 View Live




Latest Images