TDQ-9708 Regex Generation from an analysis containing a where clause
-->for pattern frequency indicator: extract the same code into one
method,and use data entity to get the related query, to replace the old
way ( substring)