Skip to content

alenon/JWildcard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JWildcard

A collection of wildcard utilities. This library helps to convert wildcards into regex string. Wildcards can be declared using custom made rules.

Examples:

This wildcard:

"mywil?card*"

will be converted to this regex string:

"\Qmywil\E.\Qcard\E.*"

In order to convert wildcard into regex string use the following example:

JWildcard.wildcardToRegex("mywil?card*");

Default wildcard rules are: "?" -> ".", "*" -> ".*", but you can change the default behaviour, by simply defining the new rules:

JWildcard.wildcardToRegex(wildcard, rules, strict);

In order to check matching directly you can use the following example:

JWildcard.matches("mywild*", "mywildcard");

In order to convert wildcard string into SQL like pattern:

JWildcard.wildcardToSqlPattern("?wild*Ca?rd*") // outputs this => _wild%Ca_rd%

Getting Started

Master Build

Direct Download

Library packages stored in both: Github and Artifactory (https://alenon.jfrog.io/) repositories

Using Gradle

build.gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.yevdo:jwildcard:1.4'
}

Using Maven

pom.xml

<distributionManagement>
    <repository>
        <id>central</id>
        <name>a0yytejrantuj-artifactory-primary-0-releases</name>
        <url>https://alenon.jfrog.io/artifactory/maven-releases</url>
    </repository>
</distributionManagement>

<dependency>
  <groupId>com.yevdo</groupId>
  <artifactId>jwildcard</artifactId>
  <version>1.5</version>
</dependency>

API

API documentation https://alenon.github.io/JWildcard/