Advertisement
Guest User

Untitled

a guest
Dec 6th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.23 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. File.new("foo.xml").each_line do |line|
  3.   re = /\\u[0-9a-fA-F]{4}/
  4.   result = ''
  5.   line.gsub(re) {|match| eval 'result += "' + match.to_s + '"' }   # I want to replace match with actual character.
  6.   puts result
  7. end
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement