Author Topic: Make escaped string  (Read 9249 times)

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Make escaped string
« 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!
« Last Edit: December 09, 2010, 01:26:53 PM by Ding Zhaojie »

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Make escaped string
« Reply #1 on: December 09, 2010, 10:49:27 AM »
Hi Ding, quite nice ! But where is the attachment... ;) HS2

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Make escaped string
« Reply #2 on: December 09, 2010, 01:27:50 PM »
Hi Ding, quite nice ! But where is the attachment... ;) HS2
Sorry, my mistake...

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Make escaped string
« Reply #3 on: December 09, 2010, 01:56:28 PM »
Thanks ! HS2
PS: Any plans to extend Bincalc to 64bit maybe incl. IPv6 ?

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: Make escaped string
« Reply #4 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.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Make escaped string
« Reply #5 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
« Last Edit: December 10, 2010, 03:48:09 AM by hs2 »