Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Regular expression to get sass imports.

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44101
    Subash
    Member

    Hi guys can you provide me regular expression to match sass and scss style @imports.

    I have tried

    /@import[s”‘]*([^”‘;n]+)[;”‘]*/g

    But it is giving me only the first @import of list

    @import “mainstyle”,
    “header”,
    “typography”,
    “somethingelese.scss”;

    It is giving me just mainstyle not the other ones. Please help.

    Here is the [pen](http://codepen.io/subash/pen/koCvm) on codepen.

    #131768
    Subash
    Member

    Solved myself. Not the best solution but works.

    http://codepen.io/subash/pen/koCvm

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.