3

Here is the regexp: /<\?nib.+\?>/im

I'm testing it on a file like this:

<html>

<head>
<title>OPEN LARK</title>
</head>

<body>
<h1>THIS IS A HEADER 

    <?nib   
             asdf
    ?>
</h1>
</body>

</html>

I am getting no matches. How can I fix this?

turnt
  • 3,235
  • 5
  • 23
  • 39

2 Answers2

8

You are using the . to match multilines. That isn't implemented in Javascript. Check this answer for a workaround.

About the workaround:

Instead of the dot, use a class and its negation to match everything. For example, replace the . with [\s\S].

Community
  • 1
  • 1
Racso
  • 2,310
  • 1
  • 18
  • 23
4

because the dot (.) doesn't match newlines.

The way in javascript is to replace the dot by [\s\S]

Casimir et Hippolyte
  • 88,009
  • 5
  • 94
  • 125