ok after playing around I got the solution!!

#! /usr/bin/perl

use strict;
use warnings;

while (<>){

       s/([-a-z
]+:([^link|visited|hover|active]))\s*(.*)/sprintf("%-32s",$1) . "$3"/ie;
       print;

}



I hope this helps someone else!!

cheers.bo

On Mon, May 9, 2011 at 9:32 AM, Robert Huttinger
<[email protected]>wrote:

> so the filter doesnt work.. and I am ok at regex, but not at perl, can
> someone help me close out this issue?
>
> so this is the filter:
>
> #! /usr/bin/perl
> use strict;
> use warnings;
> while (<>){
>        s/([-a-z ]+:)\s+(.+)/sprintf("%-20s",$1) . "$2"/ie;
>        print;
> }
>
> this is the css:
>
> .tlLinkSubQuarter {
> width:24%;
> float:left;
> overflow:hidden;
> font-size:12px;
> }
>
> When I run the filter, bbedit did its job it seems but nothing changes..
>
> can a perl pro trace this simple code for me and or explain it?
>
> cheers.bo
>
> On Sat, May 7, 2011 at 10:24 AM, Robert Huttinger <
> [email protected]> wrote:
>
>>
>> >
>> > while (<>){
>> >
>> >    s/([-a-z ]+:)\s+(.+)/sprintf("%-20s",$1) . "$2"/ie;
>> >    print;
>> > }
>> >
>>
>> So the first group is all up to the colon, then the next group starts at
>> char 20? Ten the flags i & e
>>
>> Thanks a ton!! I have had to convert lots of CSS and this makes it so much
>> cleaner.
>>
>> Cheers.Bo
>>
>> Squeezed out from my toothpaste tube
>
>
>

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to