我正在构建一个 PHP Web 应用程序,用户可以在其中从他们的 ios/mac 应用程序上传他们的字符串文件(由键和值组成)。我需要能够从这些文件中提取字符串,但似乎我的正则表达式技能已经过时了。
例如,一个看起来像这样的文件:
STRING1 = "hello";
"good = bye" = "good = bye";
NAME = "Your name is \"%@\"";
"semicolon;confusion" = "I love semicolons; I hate semicolons"; "forget new line" = "forgot new line!";
应该产生:
[0] = ["STRING1","\"hello\""]
[1] = ["\"good = bye\"","\"good = bye\""]
[2] = ["NAME","\"Your name is \"%@\"\""]
[3] = ["\"semicolon;confusion\"","\"I love semicolons; I hate semicolons\""]
[4] = ["\"forget new line\"","\"forgot new line!\""]
谢谢!