I have some JSon data like bellow…
"keywords": "creole texas louisiana swamp blues usa",
When the user use the search,i want to find the word inside the “keywords”
the word can be “creole” or “texas” or etc…
What is the best procedure for this?
if i use Lookup(), HasKey() or Value() i get all the words!!
The json is about 15.000 lines 3.2mb size
You could use a regular expression and apply it against the keywords element.
static rxWord as new RegEx
rxWord.SearchPattern = "\\b" + myWord + "\\b"
dim keywords as string = j.Lookup( "keywords, "" )
if rxWord.Search( keywords ) isa RegExMatch then
// Found it
However, a little more information on what you’d trying to do might be helpful. Perhaps the JSON should be converted to something else, like a database, or perhaps it should be laid out differently, if you have such control.
The app is for OS X for now and is a radio station list…(find & play)
i prefer to use the sqlite for this, but i don’t want users have access to Station list file…
i have the same file in xml and is the same structure.
<station> station name </station>
<keywords>creole texas louisiana swamp blues usa </keywords>
i have buy your app from apple store “RegExRX” really i like it…
use a sqlite database and encrypt the data
if you have json in the app its VERY readable as is XML
You could encrypt the SQLite file.
from what i know to encrypt the sqlite file i need external plugins right ?
Just the SQLite plugin that comes with Xojo. Encryption is built into it.
Thank you Kem,Norman and Tim.
I go to read the docs then…
One more thing. If you obscure the password in your code (use a property name that is unrelated to “password” and make it some long, random combination of characters), it will not be impossible to reverse-engineer, but it will still be harder than what you’re doing now. Plus you’ll get the benefit of the SQLite engine.
Split it into many pieces throughout your app
And dont store it in plain text in your app (a long arrays of numbers you munge to get the password maybe)
I’m sure there are a number of things you an do relatively easily to kee pthe casual observer from finding it