0

I am using regex in python to find <span class="dlog"...>Whatever you want to put here</span>, and have been using pythex and crossreferencing regexpal to match the case. However, inside of my javascript file, where I am defining a variable containing the regex, as follows:

    var tokenRe = /<span class=\"dlog\"(.*?)\>(.*?)\</span>/;

I am getting an error: SyntaxError: Invalid regular expression: missing /. Thus, I need help trying to implement this regex inside of my javascript file.

Thanks !

maudulus
  • 10,627
  • 10
  • 78
  • 117

1 Answers1

3

You did not escape the slash for </span. You also don't need so many escapes because of the regex literals:

var tokenRe = /<span class="dlog"(.*?)>(.*?)<\/span>/
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405