特定のデータなしで文字列 (ファイル名) を返す必要があります。文字列の例は次のとおりです。
- eng_somerset_yeovil_montacute-house_962.jpg
- eng_south-yorkshire_barnsley_wentworth-castle_0.jpg
- eng_staffordshire_harriseahead_mow-cop-castle_1329317.jpg
- eng_somerset_weston-super-mare_marine-lake-walkway_29113.jpg
これらのサンプル文字列は、次のように返される必要があります。
- eng_somerset_yeovil_montacute-house.jpg
- eng_south-yorkshire_barnsley_wentworth-castle.jpg
- eng_staffordshire_harriseahead_mow-cop-castle.jpg
- eng_somerset_weston-super-mare_marine-lake-walkway.jpg
以下の正規表現を使用してみましたが、パターンのみが表示され、パターンが返された後:
filename = fl.replace(/(^.*?(?=[_]{1}[0-9]{1,10}))/gi, '');
- _962.jpg
- _0.jpg
- _1329317.jpg
- _29113.jpg
ご協力いただきありがとうございます。