Alternation metacharacter


show more Alternation metacharacter provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions show less
please wait ...

Alternation metacharacter

In the last movie we learned about the grouping metacharacters, and those are going to be really useful as we turn our attention now to talk about alternation. The alternation metacharacter is just a single upright line. Take a second to locate that on your keyboard. On most keyboards it's going to be above the Return key. This is often referred to as the pipe character, because in UNIX its function is to pipe output from one command to another. In regular expressions, you'll usually hear me read it as "or," but if you hear me say pipe or pipe character, that's what it means--even though it serves a different purpose in regular expressions than it does in UNIX.

Now in some programming languages they use double pipes to represent "or." Be careful if you're familiar with those that you only use a single pipe here. So as I said, the pipe character is an or operator. It means either match the expression on the left or match the expression on the right, and...

Alternation metacharacter
Video duration: 4m 54s 5h 36m Intermediate

Viewers:

Alternation metacharacter provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions

Subject:
Developer
Software:
Regular Expressions
Author:
please wait ...