problem matching = in edit_line replace_patterns

14 views
Skip to first unread message

Seppy

unread,
Oct 20, 2014, 3:53:13 PM10/20/14
to help-c...@googlegroups.com
I'm trying to test for the case of

<limit attribute>=(space or tab)<value>

I'm unable to match and repair when the limit attribute is not seperated from  "=" by a space..

cpu= -1

bundle edit_lines sanitize_fields(limit_attributes)
{
replace_patterns:
"\s+($(limit_attributes))=\s+(\d+)"
replace_with => tidy_spacing("$(match.1)", "$(match.2)")
select_region => default;

}
body replace_with tidy_spacing(match1,match2)
}
replace_value => "     $(match1) = $(match2)";
occurrences => "all";
}

any suggestions on how i can properly match?

Thanks,

Seppy

unread,
Oct 20, 2014, 4:59:54 PM10/20/14
to help-c...@googlegroups.com
I was able to identify that the problem with the pattern match on the right hand side was due to \d+ not matching "-1"


Reply all
Reply to author
Forward
0 new messages