General questions about using WildEdit
Moderators: AmigoJack , bbadmin , helios , Bob Hansen , MudGuard
Ed
Posts: 103 Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK
Post
by Ed » Wed Mar 30, 2005 2:57 pm
I want change multi-line statements to single lines - for example:
Code: Select all
WARNING( "<some text", param1,
param2, param3,
param4 );
to
Code: Select all
WARNING( "<some text", param1, param2, param3, param4 );
where the delimiters are WARNING and ;
any ideas?
s_reynisson
Posts: 939 Joined: Tue May 06, 2003 1:59 pm
Post
by s_reynisson » Wed Mar 30, 2005 4:35 pm
This works for me on the sample provided, with a little housekeeping
Code: Select all
Find ^((WARNING|\s+).+?,)\s\n
Replace $1
Why I need the \s before the \n is a mistery to me, perhaps
Helios can shed some light on that?
And the housekeeping part would be
Code: Select all
Find ,\s+
Replace ,_
where _=space
You most likely will need to limit the above regex some more but I'm sure you get the idea. HTH
Then I open up and see
the person fumbling here is me
a different way to be
Ed
Posts: 103 Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK
Post
by Ed » Wed Mar 30, 2005 8:00 pm
I think I wasn't clear enough. There are loads of other lines of code, many of which start with spaces.
I only want to join lines that start WARNING and end with ;
I think I left the trailing space in the example. It shouldn't be there.
Having said all that I used
^( *WARNING.+?,) *\r\n
replace with
$1
and this did the trick. So many thanks s-r