-1

Angular email REGEX is :

/^[a-z0-9!#$%&'+/=?^_`{|}~.-]+@a-z0-9?(.a-z0-9?)$/i

I understand everything but I'm not sure what does the i at the end mean.

It is the only REGEX having it:

var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/;
var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/;
var MONTH_REGEXP = /^(\d{4})-(\d\d)$/;
var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
htafoya
  • 18,261
  • 11
  • 80
  • 104

4 Answers4

2

it's the case insensitive flag:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

AirCal86
  • 126
  • 2
  • 9
1

The i modifier is used to perform case-insensitive matching.

1

The i means case-insensitive. See here for more info: matchsearchhttps://www.w3schools.com/jsref/jsref_regexp_i.asp

0

It is ignore case or case-insensitive matching flag.

A and a mean the same thing.

var regex = /pattern/flags; . What ever follows is a flag used for advanced searching.

Sushanth --
  • 55,259
  • 9
  • 66
  • 105