-2

I have a simple regex I'm using and that works perfectly in chrome but edge throws a syntax error, ths is the line :

var html=text.match(/^<div.+\/div>$/ims);

I don't see the problem.

TylerH
  • 19,065
  • 49
  • 65
  • 86
Entretoize
  • 1,878
  • 3
  • 17
  • 29

2 Answers2

0

Because /s flag is not supported, use:

var html=text.match(/^<div[\s\S]+\/div>$/im);
Toto
  • 83,193
  • 59
  • 77
  • 109
0

Basically you want to match all characters with a new line character You can this regex please:-

text.match(/^<div>.+\n*.*<\/div>/)
prashantsahni
  • 1,949
  • 18
  • 19