zoukankan      html  css  js  c++  java
  • Java正则表达式匹配例子

    Java正则表达式匹配例子

     1 package com.ibm.test;
     2 
     3 import java.util.regex.Matcher;
     4 import java.util.regex.Pattern;
     5 
     6 public class Test {
     7     public static void main(String[] args) {
     8         String s=" 26301               56319.07            18324.02  ";
     9         Pattern p = Pattern.compile("(\b\w+\.*\w*\b)");
    10         //匹配http://开头,不包含/的内容
    11         Matcher match = p.matcher(s);
    12         String domain = "";
    13         while (match.find()) {
    14             domain = match.group();
    15             System.out.println(domain);
    16         }
    17         
    18         //LINESTRING(7.255032 43.701172)
    19     }
    20 }


    }
    }

  • 相关阅读:
    UVa 11988
    UVa 442
    .MySQL数据库技术
    Mysql数据库技术
    JDBC技术
    JDBC技术
    JavaSE编程基础
    JavaSE编程基础
    JavaSE编程基础
    web安全性测试
  • 原文地址:https://www.cnblogs.com/yoyogis/p/3178322.html
Copyright © 2011-2022 走看看