Page 1 of 1

how to search string within a string

Posted: Sat Dec 14, 2013 4:14 am
by Ketan Patil

i want to search string with in a string
for example

if may database contains a entry "nokia apple samsung sony honey"

i want to search for the word "apple"

pl. help


how to search string within a string

Posted: Sat Dec 14, 2013 4:30 am
by maxkatz

For searching within the database you can use regular expression. For searching within text (after you get the string from the database), you can use any JavaScript function or library out there.


how to search string within a string

Posted: Sat Dec 14, 2013 4:35 am
by Ketan Patil

pl. suggest any function


how to search string within a string

Posted: Sat Dec 14, 2013 4:38 am
by Ketan Patil

or any example, please


how to search string within a string

Posted: Sat Dec 14, 2013 4:44 am
by maxkatz

You should be able to find many examples how to parse/search strings on the Internet with JavaScript.


how to search string within a string

Posted: Sat Dec 14, 2013 4:44 am
by Ketan Patil

i am using return '{"bizname":{"$regex":"^'+value+'", "$options":"i"}}';
i can not understand how to use .match()


how to search string within a string

Posted: Sat Dec 14, 2013 4:54 am
by maxkatz