In trying to parse some data from a string, I decided to use Satimage’s regxp addition. However, I’m having some issues with it that I can’t quite figure out. According to the documentation, the default regex engine is Ruby, which is great because it supports the lookbehind and lookahead and I can use those. I tested my regular expression in Ruby:
ruby-1.9.2-p290 :056 > ref = “ABCD_oxox">Reset”
=> “ABCD_oxox">Reset”
ruby-1.9.2-p290 :057 > xx = /.*(?=">)/.match(ref).to_s
=> “ABCD_oxox”
ruby-1.9.2-p290 :058 >
So I know it works. However, in AppleScript, I can’t seem to get it to work:
– AS Begin
set RefID2 to “ABCD_oxox">Reset”
set xx to find text “.*?(?=\">)” in RefID2 with regxp and string result
– AS end
error “No result was returned from some part of this expression.” number -2763
I’m stumped… anybody got a clue on this one?
Wayne