美文网首页
【The Java™ Tutorials】【Regular Ex

【The Java™ Tutorials】【Regular Ex

作者: Ppian | 来源:发表于2018-03-23 16:23 被阅读0次

Index Methods

  • public int start(): Returns the start index of the previous match.
  • public int start(int group): Returns the start index of the subsequence captured by the given group during the previous match operation.
  • public int end(): Returns the offset after the last character matched.
  • public int end(int group): Returns the offset after the last character of the subsequence captured by the given group during the previous match operation.

Study Methods

  • public boolean lookingAt(): Attempts to match the input sequence, starting at the beginning of the region, against the pattern.
  • public boolean find(): Attempts to find the next subsequence of the input sequence that matches the pattern.
  • public boolean find(int start): Resets this matcher and then attempts to find the next subsequence of the input sequence that matches the pattern, starting at the specified index.
  • public boolean matches(): Attempts to match the entire region against the pattern. (matches要求整个字符串都匹配,而lookingAt不需要)

Replacement Methods

相关文章

网友评论

      本文标题:【The Java™ Tutorials】【Regular Ex

      本文链接:https://www.haomeiwen.com/subject/veecixtx.html