Ruby 1.9.2 invalid character property name {Katakana}: /\p{Katakana}/ workaround

OK this has nothing to do with Vim, but sometimes I want to talk about just Ruby too. I came across the following issue:

  #This is OK
  #=> ["ア", "イ", "ウ"]

  #This isn't:
  #invalid character property name {Katakana}: /\p{Katakana}/

  #Following hack works:
  line = "abc" 
  #=> []

So set your String instance variables that you want to use like that:


Or wrap your accessor up like that and you should be good to go without the rather unexpected behaviour of oniguruma (monster car 鬼車) throwing a wobbly just because it doesn't find a match.