如何找到字符串的中间,在 space 旁边和 MongoDB 中的点

How to find middle of the string, next to space and dot in MongoDB

 [
    {
        "Name": "Dr.Soma",
        "Email": "drsoma@gmail.com",
        "MobNo": 111111111
    }, 
   {
        "Name": "Bootha Ganesh",
        "Email": "boothaganesg@gmail.com",
        "MobNo": 222222222
    }, 
   {
        "Name": "Steven",
        "Email": "steven@gmail.com",
        "MobNo": 333333333
    },
    {
            "Name": "Dr.Anbarasi",
            "Email": "anbarasi@gmail.com",
            "MobNo": 4444444444
     }
     ]

我尝试使用查找正则表达式

db.details.find({Name:{$regex:/steven/i}})

输出:

   {
      "Name": "Steven",
      "Email": "steven@gmail.com",
      "MobNo": 333333333
    }

如何在 Soma 之后查找数据名称点 (.) & Space 在 Ganesh 之后
异常输出
如果我找到 Name Ganesh,我需要

{
            "Name": "Bootha Ganesh",
            "Email": "boothaganesg@gmail.com",
            "MobNo": 222222222
  }

如果我找到 Name small s or capital S ,我需要

{
        "Name": "Dr.Soma",
        "Email": "drsoma@gmail.com",
        "MobNo": 111111111
 }

不需要名字Dr.Anbarasi数据

db.collection.find({ Name: { $regex: "Soma" } })

mongoplayground


db.collection.find({ Name: { $regex: ".Soma" } })

mongoplayground


db.collection.find({ Name: { $regex: " Ganesh" } })

mongoplayground

db.collection.find({"Name": {'$regex': /\bsoma[a-zA-Z0-9]*/gi}})

\b 断言位置在 单词边界: (^\w | \w$ | \W\w|\w\W)
soma-for 搜索值
[a-zA-Z0-9]-字字符
*-整个字符串