0

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})?)?$/; 
1
  • /i is a flag, it means case insensitive. Commented Sep 8, 2017 at 23:19

4 Answers 4

2

it's the case insensitive flag:

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

1

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.

Comments

1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.