我正在尝试使用正则表达式在Drupal 8视图[Exposed Filter]中过滤出结果。我需要在特定字段的后4或5位数字/字母中搜索关键字。
These are the data I need to filter. If someone tried to search
"0022" I want to show the result as
2006ABC00022. Because the last 4 digit is 0022. We can use
Ends with operator to do this. But I want something different because If someone tried to filter the result with
"312" I want to show the results as
2019GHI03128. Because these 2 strings have
312 as starting of the last 4 digits. This scenario will not work if I use 'Ends with' operator. So I go for a regular expression.
I tried to use the regex with the above one. And I realize that this is not working as I expected. This one is searching all over the string.
If I search for
2019 it shows the last 2 results. But it should be empty.