无法在Ruby中使用它:
如果}
已经没有!important }
,我需要处理一些CSS并将!important
替换为".a { zxcv: -90px !important; }".gsub(/(?<!!important;)\s*}/, ' !important;}')
。
为此,我的替换看起来像:
\s*}
显然应该搜索!important;
之前没有\s*
\s*
仅当我不使用int[] sourceCollection = new[] { 1, 2, 3, 4, 5, 6, 7 };
int[][] arr = sourceCollection.Select(i => Enumerable.Range(i, 4).ToArray()).ToArray();
部分时才有效,否则它会忽略我的否定支票。
我知道不支持可变长度的后视,但我不在这里使用它。
在这种情况下,var a = "2015-08-06T09:45:23.315Z";
var b = new Date(a);
如何破坏我的正则表达式?
答案 0 :(得分:1)
你可以有另外一个这样的lookbehind匹配:
input.gsub(/(?<!!important; )(?<!!important;)\s*}/, ' !important;}')