php - Quoted string with quotes excaped by another quote (two double quotes) -
Then regex has been solved for a quoted string. Here's a good answer:
$ re_dq = '/ "[^" \\\\ !!!! ?? \\\\\. [^ "\\\\\" \\\\\\\ "/ s';
PHP is considered a standard solution.
My Points is that my quote has escaped from another quote. Example:
= "123 4556 789" "Product B v .24 "" "=" 00 00FF "" License Key for Blah Blah "" HFD.33 "=" "
The previous string should match the following, respectively:
string '123 4556 789 "" product b v.24 "" (length = 31) string' 00 00ff '' license key for blah blah '' HFD.33 '(Length = 48) string' '(length = 0)
The given example is only image String is what looks and not the actual string that I could be in the thousands that will match that.
I need a Reggae pattern which will match a double quoted string which is not a sequence of two double quotes.
Update 5/5/14:
Edit: For your request, minor modes in account for blank quotes.
(? & Lt;; "" (?: [^ "] |" ") *"
Basic Solution:
< Pre> (? & Lt;!) "(?: [^"] | "" ")" "
Demo:
/ P>
> Output:
2 arrays ([0] => "123 4556 789" "Product B v.24" "" [1] = "00 00FF" "Blah Blah's License Key "" HFD.33 ")
Comments
Post a Comment