Regex for Elastic Search within Graph panel not working (Lucene Query)

Hello Team,

I have started using Elastic Search recently and trying to build dashboard based on Elastic Search data sets.

I’m trying to use regex to get the Jira Key from one of field within Elastic Search.
I could see it works both in the regex101.com site and also when I define a template Variable and apply the regex to the field ( ((?=([A-Z]{1,10})-?)[A-Z]±\d+) ), I could see the searched values displayed (refer attached screen shot).

The problem I have is that, when I tried to apply the same regex within a graph panel within the query section, I’m not getting the search work here. Tried escaping the unicode characters in the expression as well ( field:/.*((?=([A-Z]{1,10})-?)[A-Z]±\d+).*/g ) but still not working,

Screen Shot 2020-04-21 at 1.16.37 PM

Could you please let me whether the regex within a template variable works differently from within a query section of graph panel (Since the data is large within a variable (more than 1024), I need to apply the regex within graph panel to get the count of matching patterns

Thanks
Sam