SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => SlickEdit User Macros => Topic started by: Ding Zhaojie on December 09, 2010, 06:10:57 am

Title: Make escaped string
Post by: Ding Zhaojie on December 09, 2010, 06:10:57 am
1. load string_copy.e
2. bind string-copy and string-paste to menu or hotkey

This macro will help you add/remove escape sequences in C/Java or XML.

For example: string-copy a C-string:
Code: [Select]
(?P<nat_dst_ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})
You will got:
Code: [Select]
(?P<nat_dst_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})The escape sequences were translated.

string-paste the text to a XML file, the text will be escaped for XML:
Code: [Select]
(?P&lt;nat_dst_ip&gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
Have fun!
Title: Re: Make escaped string
Post by: hs2 on December 09, 2010, 10:49:27 am
Hi Ding, quite nice ! But where is the attachment... ;) HS2
Title: Re: Make escaped string
Post by: Ding Zhaojie on December 09, 2010, 01:27:50 pm
Hi Ding, quite nice ! But where is the attachment... ;) HS2
Sorry, my mistake...
Title: Re: Make escaped string
Post by: hs2 on December 09, 2010, 01:56:28 pm
Thanks ! HS2
PS: Any plans to extend Bincalc to 64bit maybe incl. IPv6 ?
Title: Re: Make escaped string
Post by: Ding Zhaojie on December 10, 2010, 01:56:58 am
Thanks ! HS2
PS: Any plans to extend Bincalc to 64bit maybe incl. IPv6 ?
The 64bit support was stay in my todo list for a long time. But it will introduce big changes to the UI and I have no idea about how to put so many numbers on the small form. Maybe I should take the RPN away? Very hard to decide.
Title: Re: Make escaped string
Post by: hs2 on December 10, 2010, 03:45:01 am
Yep - it's not easy...
Removing the RPN part would be ok for me. Although I still own a working HP-48 calculator !
But I stopped using it years ago and now I prefer the common prefix notation .. and my old Casio calculator ;)
Would be cool, if you find the time to do it. I expect to deal with 64bit low level stuff in the not so far future.
HS2