3

I am working to refactor a dependency on Compass mixins to simply use CSS rules which will be vendor prefixed by autoprefixer as a post process.

So I am going through a large code-base with the need to replace strings such as:

@include border-radius($big-radius);

With something like:

border-radius: $big-radius;

The IDE I am using is PhpStorm, which provides a find/replace regex feature. What should the regex for the case above look like? I'm sure I can adapt that for many other purposes as I continue working on this.

1 Answer 1

10

Search for:

@include (.*)\((.*)\);

Replace with:

$1: $2;

The (.*) parts creates groups. the $<number> reference those groups.

Sign up to request clarification or add additional context in comments.

1 Comment

Don't forget the ; or remove it from the first search

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.