我有一个像这样的字符串
"quick" "brown" fox jumps "over" "the" lazy dog
我需要一个正则表达式来检测没有用双引号括起来的单词.经过一些随机尝试,我发现了这个("([^"]+)").这会检测用双引号括起来的字符串.但我希望相反.在试图扭转上面提到的正则表达式后,我真的无法想出它.正则表达式我很弱.请帮我
我需要构建一个正则表达式,只有当它不是某个字符串的一部分时才会找到单词"int".
我想找到是否在代码中使用int.(不是在某些字符串中,仅在常规代码中)
例:
int i; // the regex should find this one.
String example = "int i"; // the regex should ignore this line.
logger.i("int"); // the regex should ignore this line.
logger.i("int") + int.toString(); // the regex should find this one (because of the second int)
Run Code Online (Sandbox Code Playgroud)
谢谢!