Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matching uppercase or lowercase string Regex

I need to match the last part an an email and am using Regex.

It is working fine using the following "[a-zA-Z0-9._-][email protected]$" but I want the last part of the address to be upper or lower case.

so that that it will match variations such as

[email protected]
[email protected]
[email protected]

as possible scenarios...so in other words all variations of upper and lower case.

How could I change the pattern to accommodate this

like image 732
Arianule Avatar asked Jan 18 '26 15:01

Arianule


1 Answers

Use the i flag to ignore case.

Here is some more information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Description

like image 199
Rebecca Close Avatar answered Jan 20 '26 04:01

Rebecca Close



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!