In VSCode: I would like to do a wildcard replace of:
rgb(1, 1, 1 ,1)
with:
rgba(1, 1,1 ,1)
Essentially when an alpha value is specified, the datatype should be changed from "rgb" to "rgba". Where alpha is not specified e.g rgb(1,1,1) - they should remain unchanged.
I tried:
Find: rgb(.*,.*,.*,.*)
Replace: rgba($1)
which obviously did not work. What would be the correct regex syntax to achieve this? Thank you.
Update: Please note that some locations there are spaces before/after commas. Not consistent.
0-9anda-for what? - user3783243rgb\((\d+,\d+,d+,\d+)\)would do it in that case. (That's a bit looser than0-255but you can change\dto a range if that works (e.g. stackoverflow.com/questions/31684083/…)) - user3783243.*button in the find box - rioV8