RTLIT ruby tool is used to switch from LTR to RTL in css files, but it doesn't also change the padding,margin left to righ for example :
https://github.com/zohararad/rtlit/blob/master/lib/rtlit/converter.rb
padding: 1px 2px;
padding: 0 2px 4px;
padding: 1px 0 3px 4px;
padding: 1px 2px 0 4px;
padding: 1px 2px 3px 0;
need to change this values to be :
padding: 1px 2px;
padding: 0 0 4px 2px;
padding: 1px 4px 3px 0;
padding: 1px 4px 0 2px;
padding: 1px 0 3px 2px;
we need to switch always the second value with the 4th value and if they are only 3 switch the second value to the forth and set the second to 0
also if there are only 2 values , leave it as it is.
I need that regular expression in ruby or php