Guest User

Untitled

a guest
Jun 24th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. ar = "m 408.86621,382.18531 c -60.47705,2.3e-4 -60.47705,2.3e-4 -102.37687,6.91573 -125.69958,20.74653 -23.32304,13.83122 -34.98448,37.42529 s-34.98435,70.78229 M-1.3e-4,26.57737"
  2.  
  3. re = /
  4. ([m|M|c|C|s|S|q|Q]) |
  5.  
  6. ([-+]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][-+]?[0-9]+)?)\s*\,\s*
  7. ([-+]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][-+]?[0-9]+)?)
  8. /
  9.  
  10. ar.scan( re ).each { |a1 , a2 , a3, a4, a5, a6, a7, a8, a9 |
  11. if a != nil then
  12. puts "str>#{a1.to_f}"
  13. else
  14. puts " =>#{a2.to_f} #{a6.to_f}"
  15. end
  16. }
Add Comment
Please, Sign In to add comment