How can I match what's between a . and a { and merge them onto a single line without touching the spacing between them.
This regex (\.|@)[^}]*\{ inculdes the ending { no matter what I try, and I need the (\.|@) part so I can add more selectors in there. Online Regex
Yes, I know I shouldn't be doing this with regex, but I have no other option as of now. So any help will be greatly appreciated.
Edit I'll be using this in preg_replace in php
Raw data
.a {
// rules
}
.a-b,
.a-b .b, .a-b.s
.x .y, .x {
// rules
}
@a {
// rules
}
@k {
// rules
}
Output
.a {
// rules
}
.a-b, .a-b .b, .a-b.s, .x .y, .x {
// rules
}
@a {
// rules
}
@k {
// rules
}
{yet your pattern is programmed to include it.