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
  • 91,013
  • 29
  • 181
  • 233
alienlebarge
  • 2,844
  • 4
  • 23
  • 25

1 Answers1

1

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

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

DEMO

Avinash Raj
  • 166,785
  • 24
  • 204
  • 249