Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试查找字符串是否符合格式"name"/"version"。这是我期望的一个例子。
"name"/"version"
VideoPart/1.2
我尝试了很多正则表达式。我最接近的是:
"[a-z,A-Z,0-9,\\.]*/[a-z,A-Z,0-9,\\.]"
但它不识别格式。我在这个正则表达式中很具体,因为我只想要一个正斜杠。谢谢!
尝试这个:
\\b[a-zA-Z0-9.]+[/][a-zA-Z0-9.]+\\b