-3

here this.pattern is an '@mention' of somebody's username

return new RegExp(`(^|\\s|> ?)@(${ this.pattern }(@(${ this.pattern }))?)`, 'gm');

i need to make this mention to be case-insensitive

1 Answers1

0

The case insensitive flag i can be set:

return new RegExp(`(^|\\s|> ?)@(${ this.pattern }(@(${ this.pattern }))?)`, 'gmi');

This allows the regex to match without modifying the actual regex.

alexyorke
  • 4,224
  • 3
  • 34
  • 55