mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
Modified user search to include whole word search
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Escape string for special regular expression characters.
|
||||
*/
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
escapeRegExp,
|
||||
};
|
||||
Reference in New Issue
Block a user