Using Smarty template engine, but looking to pre-process HTML to change font-size across all CSS.
I want to make the whitespace(s) optional after the colon so it will match the number no matter what.
The issue is I can only seem to get optional matching as part of the expression, not the lookbehind.
RegEx: (?<=font-size: )[0-9]+
HTML excerpt:
body {
font-family: 'Open Sans', sans-serif;
font-size: 9pt;
height: 100%;
min-height: 100%;
display:block;
}
Do not use lookbehinds when you can do it easily with a capturing group.
In your case you can do something like:
Then use the capturing groups
$1and$2as you need.