RegEx Series: Alternative Characters

The pipe symbol and capture groups in regular expressions.

R.

--

Introduction

Alternate characters in regular expressions can be very useful in addition to the many ways I have previously shown you in this series to match patterns. I’ll first start with the | pipe symbol which works very much the same way as it does in our conditional statements, functioning as ‘or’. Second, I’ll show you how to also use the () parenthesis in the regular expression to create capture groups as well to help specify which…

--

--