java - 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.
解决方案
you can use "unread messagges from \d+". it will match to "unread messagges from "
推荐阅读
- java - 如何在 Java If 语句中使用 OR
- java - 谷歌 OAuth2 获取服务帐户的访问令牌:连接超时
- python - 如何使用lambdify进行导数函数?
- deno - 在 Deno 中读取大型 JSON 文件
- iis - .NET Core 3.0 GA 与 .NET Core 3.0 Preview 8 并行
- json - 如何为接收到的 JSON 格式定义没有 POJOS 的数据模型?
- laravel - 如何从两个单独的表中调用变量
- javascript - 如何设置条件函数以响应一个组件而不是更大的组件
- amazon-web-services - 我正在尝试使用 AWS EB CLI (elastic beanstalk) 部署 python 应用程序
- java - CloseableHttpClient 和 CloseableHttpResponse 是否都需要显式关闭