【问题标题】:What is the use of the "$" in regex pattern? [duplicate]正则表达式模式中“$”的用途是什么? [复制]
【发布时间】:2015-04-24 15:06:49
【问题描述】:

一个模式有这些$的用处,它有什么用呢?会是对*相似的补充吗?

代码

    Pattern tempoPattern = Pattern.compile("s$");
    Matcher tempoMatcher = tempoPattern.matcher(normalizado);

    Pattern bytesPattern = Pattern.compile("(k|m|g)b$");

【问题讨论】:

标签: java regex


【解决方案1】:

如果你查看Pattern的文档

边界匹配器

$ 一行的结尾

【讨论】:

    猜你喜欢
    • 2015-07-21
    • 2013-01-12
    • 1970-01-01
    • 2014-06-01
    • 2013-08-21
    • 2016-08-31
    • 1970-01-01
    • 2016-07-18
    • 2011-06-15
    相关资源
    最近更新 更多