rootx Posted June 26, 2014 Posted June 26, 2014 I would like to replace the percentage of width div.gallery { float: left; width:20%; } I tried... $colread = "10%" $replace = StringRegExpReplace($colcss,'([0-9][^;])',$colread) This mode does not work well, can you help me to intercept the exact text between width:????????; Thanks guys
Solution jguinch Posted June 26, 2014 Solution Posted June 26, 2014 (edited) Something like this ? $colread = "10%" $colcss = "div.gallery { float: left; width:20%; }" $replace = StringRegExpReplace($colcss,"(?<= |;|\{)(width:)[^;]+", "${1}" & $colread) ConsoleWrite($replace) Edited June 26, 2014 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
sahsanu Posted June 26, 2014 Posted June 26, 2014 Hello, You could try something like this: $colcss = "div.gallery { float: left; width: 20%; }" $colread = "10%" $replace = StringRegExpReplace($colcss, '(?i)(width:\s?)([0-9]{1,3}%)(\s?;)', "${1}" & $colread & "${3}") Cheers, sahsanu
jguinch Posted June 26, 2014 Posted June 26, 2014 Our examples are working. Please, post your code Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
rootx Posted June 26, 2014 Author Posted June 26, 2014 Our examples are working. Please, post your code Excuse me, it works perfectly, thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now