正则表达式匹配/data/misc/wifi/wpa_supplicant.conf的WiFi名称与密码:

String regex_name="ssid=\"(.*?)\"";
String regex_psk="psk=\"(.*?)\"";

核心代码:

Pattern
p_name=Pattern.compile(regex_name);
Pattern p_psk=Pattern.compile(regex_psk);
List<Wifi_bean> wifi=new ArrayList<Wifi_bean>();
    Matcher m_name =
p_name.matcher(conf_wifi);
    Matcher
m_psk=p_psk.matcher(conf_wifi);
    while(m_name.find()){
        wifi.add(new
Wifi_bean(m_name.group(),"=========="));
    }
    while(m_psk.find()){
        wifi.add(new
Wifi_bean("----------", m_psk.group()));
    }

正则表达式匹配/data/misc/wifi/wpa_supplicant.conf的WiFi名称与密码的更多相关文章

  1. Python 使用正则表达式匹配IP信息

    使用正则表达式匹配IP地址 .MAC地址 .网卡名称: #!/usr/bin/env python #-*- coding:utf-8 -*- import re from subprocess im ...

  2. Unable to open connection to supplicant on "/data/misc/wifi/sockets/wlan0"

    在调试android wifi UI 的时候,出现了 logcat:  Unable to open connection to supplicant on "/data/misc/wifi ...

  3. wpa_supplicant.conf

    转自:http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=blob_plain;f=wpa_supplicant/wpa_supplicant.conf ### ...

  4. .NET正则表达式匹配Silverlight

    这是一个.NET正则表达式匹配工具的Silverlight 在页面中加入以下代码就可以了: <"> <param name="source" value ...

  5. RELabel : 一个极简的正则表达式匹配和展示框架

    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi ...

  6. nginx-location正则表达式匹配规则及动静分离

    nginx-location正则表达式匹配规则及动静分离  发表于 2018年03月5日 |  分类于 nginx|  0 nginx,location常用正则表达式,及nginx动静分离 nginx ...

  7. [LeetCode] Regular Expression Matching 正则表达式匹配

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  8. 在Visual Studio中使用正则表达式匹配换行和批量替换

    系统环境:Windows 8.1 Enterprise Update 2 x64 开发环境:Mircosoft Visual Studio Ultimate 2013 Update 2 RC 问题:如 ...

  9. Flex的正则表达式匹配速度与手工代码的比较

    flex是一个词法分析器生成器,它是编译器和解释器编程人员的常用工具之一.flex的程序主要由一系列带有指令(称为动作代码)的正则表达式组成.在匹配输入时,flex会将所有的正则表达式翻译成确定性有穷 ...

随机推荐

  1. 浅谈struts2之chain

    转自:http://blog.csdn.net/randomnet/article/details/8656759 前一段时间,有关chain的机制着实困绕了许久.尽管网上有许多关于chain的解说, ...

  2. LinkList(JAVA版,contain rear)

    //含有rear,尾插时时O(1)的复杂度package linearList;//凡是实现后插后删都比较容易,尽量向着这个方向转换public  class linearList {      cl ...

  3. web应用程序传递连接字符串给FastReport数据源

    public static FastReport.Report fr = new FastReport.Report(); public static FastReport.EnvironmentSe ...

  4. PHPstudy 无法启动Apache

    今天打安装完phpstudy的时候,启动Apache发现端口被占用,这个端口也就是system端口.如果想要启动服务器必须关掉这个,但是会导致系统无法正常显示. 后来我就在网上搜各种办法,依然没成功. ...

  5. R语言中的logical(0)和numeric(0)以及赋值问题

    logical(0) 不等于 numeric(0).两者都不等于NULL值,即is.null(logical(0))和is.null(numeric(0))返还值都是FALSE.这很有意思,说明长度为 ...

  6. JS实现回到顶部效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. Build Android Webrtc Libjingle Library On Ubuntu

    Our team is developing an app to help people solve problem face to face. We choose webrtc protocol a ...

  8. init.css

    [24/7金,15] Mon Feb 29 2016 16:29:25 GMT+0800 yahoo.css.yahari @charset "utf-8"; /*yahoo*/ ...

  9. iOS开发零基础--Swift教程 类型转换

    常见的类型转化符号 is : 用于判断一个实例是否是某一种类型 as : 将实例转成某一种类型 例子 // 1.定义数组 let array : [AnyObject] = [12, "wh ...

  10. 我的iOS之路2

    第一篇果然没人看呢...好吧...那就当笔记做吧...第一篇主要写的是生成了一个helloworld,可能也是和别人撞了,所以有点厌烦,连名字都改掉吧 好,开始写第二篇 之前做第一个应用程序的时候没有 ...