Regular expression to match start of filename and filename extension

后端 未结 8 839
离开以前
离开以前 2020-12-08 15:35

What is the regular expression to match strings (in this case, file names) that start with \'Run\' and have a filename extension of \'.py\'?

The regular expression s

8条回答
  •  北海茫月
    2020-12-08 16:20

    Warning:

    • jobscry's answer ("^Run.?.py$") is incorrect (will not match "Run123.py", for example).
    • orlandu63's answer ("/^Run[\w]*?.py$/") will not match "RunFoo.Bar.py".

    (I don't have enough reputation to comment, sorry.)

提交回复
热议问题