JWildcard

JWildcard - wildcard utilities for Java

License

License

MIT
GroupId

GroupId

com.yevdo
ArtifactId

ArtifactId

jwildcard
Last Version

Last Version

1.4
Release Date

Release Date

Type

Type

jar
Description

Description

JWildcard
JWildcard - wildcard utilities for Java
Project URL

Project URL

https://github.com/alenon/JWildcard
Source Code Management

Source Code Management

https://github.com/alenon/JWildcard

Download jwildcard

How to add to project

<!-- https://jarcasting.com/artifacts/com.yevdo/jwildcard/ -->
<dependency>
    <groupId>com.yevdo</groupId>
    <artifactId>jwildcard</artifactId>
    <version>1.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.yevdo/jwildcard/
implementation 'com.yevdo:jwildcard:1.4'
// https://jarcasting.com/artifacts/com.yevdo/jwildcard/
implementation ("com.yevdo:jwildcard:1.4")
'com.yevdo:jwildcard:jar:1.4'
<dependency org="com.yevdo" name="jwildcard" rev="1.4">
  <artifact name="jwildcard" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.yevdo', module='jwildcard', version='1.4')
)
libraryDependencies += "com.yevdo" % "jwildcard" % "1.4"
[com.yevdo/jwildcard "1.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

JWildcard

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

Getting Started

Build Status Download
Sonar quality gates Sonar Lines of code Sonar Coverage

Gradle build.gradle

repositories {
    jcenter()
}

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

Maven pom.xml

<dependency>
  <groupId>com.yevdo</groupId>
  <artifactId>jwildcard</artifactId>
  <version>1.4</version>
  <type>pom</type>
</dependency>

API

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

Examples:

This wildcard:

"mywil?card*"

will be converted to this regex string:

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

If you wish to convert wildcard to regex string use:

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

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

JWildcard.wildcardToRegex(wildcard, rules, strict);

If you wish to check matching directly you can use this:

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

If wish to convert wildcard string to SQL like pattern:

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

Versions

Version
1.4
1.3