View Single Post
Old 12-18-2019, 10:14 AM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,695
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You're not alone. I consider my Fu to be fair-to-middlin', and conditionals just make my head hurt. I've yet to find a use for them, myself. Lookarounds usually suffice for my needs. For instance, the following expression should ignore any form of "font-size: 1em". Regardless of whether it's:

font-size: 1em
font-size:1em
font-size: 1.0em
font-size:1.0em
font-size: 1.00em
font-size: 1em;

Code:
font-size:(?!\s*(1(\.0+)?em))\s*\K[^(;|})]*
You should then be able to replace the resulting match with any value you like.

I realize the regex conditional might have become your "white whale" at this point. If so, feel free to share any working solution you might eventually come up with.

Last edited by DiapDealer; 12-18-2019 at 10:21 AM.
DiapDealer is offline   Reply With Quote