要把css里的px统一换成rem.比例是1:40要怎么批量替换呢

要把css里的px统一换成rem.比例是1:40要怎么批量替换呢

.box {
  .box-header {
    padding: 2.1rem 0;
    color: #393939;
    text-align: center;

    .title {
      font-size: 34px;
      font-weight: bold;
      line-height: 41px;
      text-align: center;
      color: #333333;
    }

    .label {
      margin-top: 18px;
      font-size: 18px;
      font-weight: normal;
      line-height: 22px;
      text-align: center;
      color: #666666;
    }
  }

  .box-content {
    .buttons {
      a {
        margin: 0 auto;
        display: block;
        width: 170px;
        height: 44px;
        border-radius: 6px;
        opacity: 1;
        background: #FF7226;
        text-align: center;
        font-size: 16px;
        font-weight: bold;
        line-height: 44px;
        letter-spacing: 5.33px;
        color: #FFFFFF;
      }
    }
  }
}

复制文本到控制台,正则匹配吧 要想快的话