Search bar sample tutorial with filtering

Goodday everyone, is there anyone can post a sample search bar that can filter? example if i type “A” only A at the beginning will come up…some languages has an example for searching method…how about in lua? using the corona sdk thanks sirs and godbless…im newbie and i want to learn in lua programming. 

https://coronalabs.com/blog/2015/05/12/tutorial-responsive-real-time-searching/

The Code:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/05/responsiveSearches/code.zip

i tried it already but can’t filtered if i type “A” all words that has “A” at the second letter or third letter will come up also like the word “BABY” it will come up because it has also "A"therefore it should not i want it only at the begginning… so its not filtering.I want the letter at the beginning only will come up… or if I type “AB” first and second letter will come up…

You’ll want to google “Lua string filtering” or “Lua pattern matching” to learn about specific pattern matching.

One of my favorite sites is http://www.rosettacode.org

A little searching finds this:

http://www.rosettacode.org/wiki/String_matching#Lua

A moment’s work lets you write this:

local function firstCharEqual( str, char ) return ( string.find( str, char ) == 1 ) end

https://coronalabs.com/blog/2015/05/12/tutorial-responsive-real-time-searching/

The Code:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/05/responsiveSearches/code.zip

i tried it already but can’t filtered if i type “A” all words that has “A” at the second letter or third letter will come up also like the word “BABY” it will come up because it has also "A"therefore it should not i want it only at the begginning… so its not filtering.I want the letter at the beginning only will come up… or if I type “AB” first and second letter will come up…

You’ll want to google “Lua string filtering” or “Lua pattern matching” to learn about specific pattern matching.

One of my favorite sites is http://www.rosettacode.org

A little searching finds this:

http://www.rosettacode.org/wiki/String_matching#Lua

A moment’s work lets you write this:

local function firstCharEqual( str, char ) return ( string.find( str, char ) == 1 ) end