Android SDK 并没有包含 Java 7 新增加的命名捕获组功能,需要使用第三方库 https://github.com/tony19/named-regexp

import com.google.code.regexp.Pattern;
import com.google.code.regexp.Matcher; public class NamedRegexpTest {
public static void main(String[] args) {
// pattern contains capture group, named "foo"
Matcher m = Pattern.compile("(?<foo>\\w+) world").matcher("hello world!");
m.find();
System.out.println(m.group("foo")); // prints "hello"
}
}

参考

[Android Tips] 21. Regex Named Groups in Android的更多相关文章

  1. Android API 21 Toolbar Padding

    up vote117down votefavorite 44 How do I get rid of the extra padding in the new Toolbar with Android ...

  2. Android Tips – 填坑手册

    出于: androidChina   http://www.androidchina.net/3595.html 学习 Android 至今,大大小小的坑没少踩,庆幸的是,在强大的搜索引擎与无私奉献的 ...

  3. CyanogenMod wiki reading tips | Android tips

    To Enable the Developer and Performance settings on CyanogenMod 10.1 In the Settings app, choose the ...

  4. [Android Tips] 25. ADB Command Note

    copy from https://github.com/operando/Android-Command-Note Android Command Note Logcat adb logcat -v ...

  5. Android Tips: 打电话和发短信

    利用Android打电话非常简单,直接调用Android内在的电话功能就可以了. btnDail.setOnClickListener(new OnClickListener(){ @Override ...

  6. [Android Tips] 9. framework notification layout font size

    android 4.4 framework notification layout 相关字体大小 * title: notification_title_text_size: 18dp * conte ...

  7. Android tips(八)-->Android Studio打包apk,aar,jar包

    文本我们将讲解android studio打包apk,aar,jar包的相关知识.apk包就是android系统的安装包,这里没什么好说的,aar包是android中独有的类库包,而jar包是java ...

  8. 【Android】21.4 图片动画缩放示例

    分类:C#.Android.VS2015: 创建日期:2016-03-21 一.简介 该例子演示如何动画缩放图片,实现类似"点击看大图"的效果. 二.示例 1.运行截图    2. ...

  9. 【Android 应用开发】GitHub 优秀的 Android 开源项目

    原文地址为http://www.trinea.cn/android/android-open-source-projects-view/,作者Trinea 主要介绍那些不错个性化的View,包括Lis ...

随机推荐

  1. iOS NSOperation 异步加载图片 封装NSOperation 代理更新

    #import <Foundation/Foundation.h> @class MYOperation; @protocol MYOperationDelecate <NSObje ...

  2. [leetcode] 29. divide two integers

    这道题目一直不会做,因为要考虑的corner case 太多. 1. divisor equals 0. 2. dividend equals 0. 3. Is the result negative ...

  3. eclipse运行速度优化(解决狂读盘、发布慢、CPU100%等问题)

    转自:http://blog.csdn.net/wyp_810618/article/details/8953921 我的ECLIPSE运行时速度奇慢,具体表现为: 1.只要ECLIPSE启动后,硬盘 ...

  4. [软件推荐]VMware Workstation 12.1.1多国语言(含简体中文)+激活方法

    虚拟机VMware功能强大,使用方便,可以在同一台电脑上安装多个系统(Windows.Linux.OS).虚拟机上的所有操作都不会影响到“实体机”,因此在虚拟机中可以进行很多测试操作,如果某些软件使用 ...

  5. MyEclipse10的一些问题(git插件,jdk7)

    egit: MyEclipse10 要装 egit2.3,版本错了安装不成功; jdk7: 10.5好像是不支持JDK1.7的,换成10.7; JDK1.7中的switch支持String类型的,1. ...

  6. XVI Open Cup named after E.V. Pankratiev. GP of SPB

    A. Bubbles 枚举两个点,求出垂直平分线与$x$轴的交点,答案=交点数+1. 时间复杂度$O(n^2\log n)$. #include<cstdio> #include<a ...

  7. BZOJ 1246 & 有点不一样的概率DP

    题意: 题意够坑的啊... 一个色子有n个面,第k次掷出一个加上这个k.求掷出所有面的期望值. 我一直以为值是色子面上的... 那么问题来了在色子面上怎么做...n还是1w级别... SOL: 对着理 ...

  8. ASIHttpRequest 使用理解

    开源库:ASIHttpRequest ASIHttpRequest 下载网址:http://github.com/pokeb/asi-http-request 依赖的5个库文件:CFNetwork, ...

  9. Linux CentOS6.5下安装Oracle ASM

    Oracle版本:Oracle 11g 1.确定自己的Linux版本: [root@localhost ~]#uname -r 2.6.32-431.el6.x86_64 2.6.32-431.el6 ...

  10. NOI 题库 6266

    6266  取石子游戏 描述 有两堆石子,两个人轮流去取.每次取的时候,只能从较多的那堆石子里取,并且取的数目必须是较少的那堆石子数目的整数倍.最后谁能够把一堆石子取空谁就算赢. 比如初始的时候两堆石 ...