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.
文字と数字に一致する正規表現が必要ですが、シーケンス「00」には一致しません。
たとえば、「hello00world00number001」は、「hello」、「world」、「number」、および「1」と一致する必要があります。
私は成功せずにテストしました:
(?:[\w](?<!00))+
編集: "hello000world0000number000001" は、"hello0" "world" "number0" と "1" に分ける必要があります。
次のパターンで「hello000world0000number000001」を分割できます。
(00)+(?=0?[^0])
str = "hello00world00number001" str.split("00")
これが機能しない理由