Regex pattern to choose data BETWEEN matching quotation marks

后端 未结 5 914
悲哀的现实
悲哀的现实 2020-12-19 08:59

Suppose I had the following string I wanted to run a Regular expression on:

This is a test string with \"quotation-marks\" within it.
The \"problem\" I am ha         


        
5条回答
  •  悲哀的现实
    2020-12-19 09:46

    I will split the string into an array of string, using quotation-mark " as delimiter. Then all the strings with an odd number index will be the string within a pair of quotation mark, use your regex on aSplittedString[oddIndex] only, then join the whole array with ".

提交回复
热议问题