在 Java 中,我将使用什么正则表达式来匹配只有一个冒号的字符串并确保冒号出现在任何空格之前?
例如,它应该匹配这些字符串:
label: print "Enter input"
But: I still had the money.
ghjkdhfjkgjhalergfyujhrageyjdfghbg:
area:54
但不是
label: print "Enter input:"
There was one more thing: I still had the money.
ghfdsjhgakjsdhfkjdsagfjkhadsjkhflgadsjklfglsd
area::54