get White space Regex Pattern - Java java.util.regex

Java examples for java.util.regex:Match New Line

Description

get White space Regex Pattern

Demo Code


//package com.java2s;
import java.util.regex.*;

public class Main {
    private static Pattern whiteSpacePattern;

    public static Pattern getWhitespacePattern() {
        if (whiteSpacePattern == null) {
            whiteSpacePattern = Pattern.compile("^\\p{Blank}+");
        }/*from w w  w  . j  av  a  2s  . c o  m*/

        return whiteSpacePattern;
    }
}

Related Tutorials