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,125
  • 5
  • 22
  • 37

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,116
  • 1
  • 14
  • 23
4

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

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

Casimir et Hippolyte
  • 85,718
  • 5
  • 90
  • 121