ruby - Find last " in strings where " are written as "" -


i'm trying write (ruby) regex capturing double quote closes eviews string. in eviews, strings enclosed double quotes , include actual double quotes in string, write double double quotes:

mystr = "item1 item2 item3" mystr2 = """item1"" ""item2"" ""item3""" 

strings can appear wherever on line, i'm not helped using beginnings , endings of lines.

what have far is:

((?<="")|(?<!"))(")(?!") 

that is, find double quote preceded either 2 double quotes or no double quote , not succeeded double quote. captures closing double quote, sadly opening one.

on side note, reason need i'm working yaml file describing eviews syntax sublime text 3. capturing strings, have far:

strings:   - match: '"'     scope: punctuation.definition.string.begin.eviews     push: string  string:   - meta_scope: string.quoted.double.eviews   - match: '"' #((?<="")|(?<!"))(")(?!")     scope: punctuation.definition.string.end.eviews     pop: true 

this question perhaps not phrased in best way. ended solution perhaps bit clumsy, works:

strings:   - match: '"'     scope: punctuation.definition.string.begin.eviews     push: string  string:   - meta_scope: string.quoted.double.eviews   - match: '""'   - match: '"'     scope: punctuation.definition.string.end.eviews     pop: true 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -