Regex, get string value between two characters

前端 未结 4 1719
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 07:31

I\'d like to return string between two characters, @ and dot (.).

I tried to use regex but cannot find it working.

(@(.*?).)

Anybod

4条回答
  •  星月不相逢
    2020-12-03 08:10

    Try this regular expression:

    @([^.]*)\.
    

    The expression [^.]* will match any number of any character other than the dot. And the plain dot needs to be escaped as it’s a special character.

提交回复
热议问题