What does the “Nothing to repeat” error mean when using a regex in javascript?

You need to double the backslashes used to escape the regular expression special characters. However, as @Bohemian points out, most of those backslashes aren’t needed. Unfortunately, his answer suffers from the same problem as yours. What you actually want is: The backslash is being interpreted by the code that reads the string, rather than passed … Read more

Arrays and -contains – test for substrings in the elements of an array

It looks like your misconception was that you expected PowerShell’s -contains operator to perform substring matching against the elements of the LHS array. Instead, it performs equality tests – as -eq would – against the array’s elements – see this answer for details. In order to perform literal substring matching against the elements of an … Read more

Case insensitive search in Mongo

You can Use $options => i for case insensitive search. Giving some possible examples required for string match. Exact case insensitive string db.collection.find({name:{‘$regex’ : ‘^string$’, ‘$options’ : ‘i’}}) Contains string db.collection.find({name:{‘$regex’ : ‘string’, ‘$options’ : ‘i’}}) Start with string db.collection.find({name:{‘$regex’ : ‘^string’, ‘$options’ : ‘i’}}) End with string db.collection.find({name:{‘$regex’ : ‘string$’, ‘$options’ : ‘i’}}) Doesn’t … Read more