Trouble using Validators.pattern Regex to match URL

I am trying to create a regular expression to match a website URL for some form validation. Here is the regex I am using:


While I know that this is not a “perfect” regex for validating a URL, I am getting inconsistencies between using the regex in ionic vs. my web tests.

For example, i plugged the regex into and several examples are working just fine:

However, when I run my ionic app, none of my patterns are matching.

I know that I am using Validators.pattern() properly because I have already added a regex validator for email inputs. I also know that I’m using it properly because I am able to plug in simple patterns, like http ang the validation works fine.

Somewhere along the way, the Ionic pattern is failing to parse as a normal regex would.

Is there something about using regex in Ionic that I am missing?