Jump to content

Recommended Posts

Posted

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
Posted (edited)

Something like this ?

$colread = "10%"
$colcss = "div.gallery { float: left; width:20%; }"
$replace = StringRegExpReplace($colcss,"(?<= |;|\{)(width:)[^;]+", "${1}" & $colread)
ConsoleWrite($replace)
Edited by jguinch

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...