[英]Exclude a portion of a string with regex
我有下面的字符串:
產品識別-AZEC
如何創建正則表達式以排除產品標識-僅返回下一個字符串,在這種情況下為AZEC
String str = "Identification of the product - AZEC";
System.out.println(str.split(" - ")[1]); // AZEC
我嘗試了以下方法,這似乎可行:
(?m)(?<= \\ b產品標識-)。* $
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.