-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
  • 20,816
  • 57
  • 73
  • 92
Entretoize
  • 2,002
  • 3
  • 20
  • 37

2 Answers2

0

Because /s flag is not supported, use:

var html=text.match(/^<div[\s\S]+\/div>$/im);
Toto
  • 86,179
  • 61
  • 85
  • 118
0

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

text.match(/^<div>.+\n*.*<\/div>/)
prashantsahni
  • 2,070
  • 19
  • 19