Regular expression - starting and ending with a character string

后端 未结 3 427
梦如初夏
梦如初夏 2020-11-27 03:03

I would like to write a regular expression that starts with the string \"wp\" and ends with the string \"php\" to locate a file in a directory. How do I do it?

Examp

3条回答
  •  死守一世寂寞
    2020-11-27 03:41

    Example: ajshdjashdjashdlasdlhdlSTARTasdasdsdaasdENDaknsdklansdlknaldknaaklsdn

    1) START\w*END return: STARTasdasdsdaasdEND - will give you words between START and END

    2) START\d*END return: START12121212END - will give you numbers between START and END

    3) START\d*_\d*END return: START1212_1212END - will give you numbers between START and END having _

提交回复
热议问题