Regular expressions in TypeScript
Let's make a variable that contains regular expression:
let reg: RegExp;
Let's write a regular expression into it:
let reg: RegExp = /.+?/;
Or we can use an alternative way to specify a regular expression:
let reg: RegExp = new RegExp('.+?');
Create a variable that will contain the regular expression.