我是新手regex
。我正在寻找与以下模式匹配的正则表达式并提取字符串,
key1=test1
key2="test1" // which will extract test1 stripping quotes
key3=New test
key4=New" "test // which will extract New" "test - as it is if the quotes come in between
我尝试使用\\s*(\\S+)\\s*=\\s*(\\S+*+)
,但不确定如何包含引号(如果存在)。任何帮助将不胜感激。