Elastic search regex to get last 7 digits from right
问题 I have data indexed in this format 676767 2343423 2344444 32494444. I need a regular expression to pattern anlayser last 7 digits from right. Ex output: 2494444. Pattern which we have tried [0-9]{7} which is not working. 回答1: In ElasticSearch, the pattern is anchored by default. That means, you cannot rely on partial matches, you need to match the entire string and capture the last consecutive 7 digits . Use .*([0-9]{7}) where .* - will match any 0+ chars other than newline (as many as