Regular Expression only match if String ends with target

前端 未结 2 1043
忘了有多久
忘了有多久 2020-11-30 11:00

I need a regular expression that will only match to the String if it ends with the target that I am looking for. I need to locate a file with a specific extension, problem i

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 11:31

    Use an end anchor ($):

    .*\.ccf$
    

    This will match any string that ends with .ccf, or in multi-line mode, any line that ends with .ccf.

提交回复
热议问题