首页 > 解决方案 > How to filter a specific text only when in front of it there is a number and such number is not known?

问题描述

I need a string to filter messages that contain a specific set of words in a definitive order (for instance "unread messages from") and that, at the same time, in front of such set of words have a number whose value is unknown (it could be 10 as well as 2000).

I will use it on Tasker, an Android app installed on my smartphone, so I would need the lightest and quickest string as possible. If it helps to simplify the logic, we can define the maximum number.

标签: javaregex

解决方案


you can use "unread messagges from \d+". it will match to "unread messagges from "


推荐阅读