Java Regex Create toRegex(String includes)

Here you can find the source of toRegex(String includes)

Description

to Regex

License

Open Source License

Parameter

Parameter Description
includes a parameter

Declaration

private static String toRegex(String includes) 

Method Source Code

//package com.java2s;
/*//from  w  ww .  jav a2 s. c o m
 *  Copyright 2009-2010 The Inframesh Software Laboratory (ISL)
 *
 *  Licensed under the Inframesh Free Software License (the "License"), 
 *   Version 1.0 ; you may obtain a copy of the license at
 *
 *     http://www.inframesh.org/licenses/LICENSE-1.0
 *
 *  Software distributed under the License is distributed  on an "AS IS" 
 *  BASIS but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License 
 *  for more details.
 *
 *  Inframesh, Websquare, Jex are all reserved marks.
 */

public class Main {
    /**
     * @param includes
     * @return
     */
    private static String toRegex(String includes) {
        return includes == null ? ".*" : includes.replace(".", "/").replace("*", ".*");
    }
}

Related

  1. toRegEx(String input)
  2. toRegex(String name)
  3. toRegex(String param)
  4. toRegex(String wildcard)