Regular expression to match a dot

后端 未结 6 571
无人共我
无人共我 2020-11-22 09:51

Was wondering what the best way is to match \"test.this\" from \"blah blah blah test.this@gmail.com blah blah\" is? Using Python.

I\'ve tri

6条回答
  •  天命终不由人
    2020-11-22 10:41

    In javascript you have to use \. to match a dot.

    Example

    "blah.tests.zibri.org".match('test\\..*')
    null
    

    and

    "blah.test.zibri.org".match('test\\..*')
    ["test.zibri.org", index: 5, input: "blah.test.zibri.org", groups: undefined]
    

提交回复
热议问题