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.
私はのような時間の文字列を持っています5:11,14:00,17:11,22:00。
5:11,14:00,17:11,22:00
を取得するには、1つおきのコンマをセミコロンに置き換える必要があります5:11,14:00;17:11,22:00。
5:11,14:00;17:11,22:00
正規表現はどうなりますか?
これはそれを行う必要があります:
var times = '5:11,14:00,17:11,22:00'; times.replace(/(,[^,]*),/g, '$1;');