1

Here is a sample JSONArray in which I am trying to search using JsonPath:

["ح م د","ر ب ب","ع ل م","ر ح م","م ل ک","ی و م","د ی ن","ع ب د","ع ون","ع ون","س ف ہ","س ف ہ"]

Its an array of Arabic characters. I am trying to search for value that begins with specific character, for eg. س (seen)

I am using JsonPath like this:

JsonPath.read(myJSONArray.toString(), "$[*][?(@ =~ /^س/i)]", null);

Its returning 0, whereas it should return 2 values as per the sample data. Any idea why the expression not working?

Note: My actual JSONArray includes records in 1000s. So if you think there is better approach than to use JsonPath java library, then your suggestion are most welcome. :)

codelearner
  • 1,354
  • 1
  • 16
  • 32

0 Answers0