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.
これ(/\;$/, "");を最後に削除する必要があります。文字列から。しかし、結果は入力と同じです。
(/\;$/, "");
次の正規表現が機能するはずです。
\;(?=[^;]*$)
したがって、置換コードは次のようになります。
(\;(?=[^;]*$), "");
RegExrで動作する正規表現の例を次に示します。