時間:2024-03-04 00:33作者:下載吧人氣:17
1.作用與語法描述
作用: 正則表達式是使用指定字符串來描述、匹配一系列符合某個句法規則的字符串。許多程序設計語言都支持利用正則表達式進行字符串操作。MongoDB 使用 $regex 操作符來設置匹配字符串的正則表達式。
語法一
{ <field>: { $regex: /pattern/, $options: ‘<options>’ } }
{ <field>: { $regex: ‘pattern’, $options: ‘<options>’ } }
{ <field>: { $regex: /pattern/<options> } }
網友評論