請我需要幫助完成以下事項:正則表達式模式在Java中
我有許多文件,就像在陣列中的以下內容:
jack+0.txt
jack+2.txt
jack+4.txt
tim+0.txt
tim+2.txt
tim+4.txt
raph+0.txt
raph+2.txt
raph+4.txt
wells+0.txt
wells+2.txt
wells+4.txt
etc.
我想編寫一個程序做如下:
if the filename is like *0.txt, a++;
if the filename is like *2.txt, b++;
if the filename is like *4.txt, c++;
需要的核心幫助是使用正則表達式(在Java中)。
謝謝你們,我嘗試了建議的方法和將在短時間內恢復。 – bdfios