Jump to content

StringRegExpReplace css tag


Go to solution Solved by jguinch,

Recommended Posts

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

Link to comment
Share on other sites

  • Solution

Something like this ?

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

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
 Share

×
×
  • Create New...