0

I'm looking to select all calc() value in a CSS file.

calc\(.*\) works to select the value when it's on one line. But I can't make it on multiline value.

Here's an exemple

h1 {
    font-size: calc( 1rem * 1.26 * 1.26 * 1.26 );
}

h1 {
    font-size: calc( 
                       1rem 
                       * 1.26 
                       * 1.26
                       * 1.26
                   );
}
Maroun
  • 94,125
  • 30
  • 188
  • 241
alienlebarge
  • 3,008
  • 5
  • 24
  • 26

1 Answers1

1

Use [\s\S]*? to match any kind of character (including line breaks).

\bcalc\([\s\S]*?\)

DEMO

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274