pom

regular expression extension

License

License

GroupId

GroupId

com.github.jeppeter
ArtifactId

ArtifactId

reext
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

pom
regular expression extension
Project URL

Project URL

https://github.com/jeppeter/reext
Source Code Management

Source Code Management

https://github.com/jeppeter/reext

Download reext

How to add to project

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

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

reext

java regular expression extension library

Maven configuration:

<dependency>
    <groupId>com.github.jeppeter</groupId>
    <artifactId>reext</artifactId>
    <version>1.0</version>
</dependency>

Gradle configuration

    compile group: 'com.github.jeppeter', name: 'reext', version: '1.0'

Split string

    import com.github.jeppeter.reext.ReExt;
    public class ReExtTest {
        public static void main(String[] args) {
            String restr="\\s+";
            String instr ="hello world";
            String[] retstr = ReExt.Split(restr,instr);
            int i;
            for (i=0;i<retstr.length;i++) {
                System.out.println(String.format("[%d]=%s",i,retstr[i]));
            }
            instr = "cc ss bb";
            retstr = ReExt.Split(restr,instr,2);
            System.out.println("split max limit");
            for (i=0;i<retstr.length;i++) {
                System.out.println(String.format("[%d]=%s",i,retstr[i]));
            }
        }
    }

result is

[0]=hello
[1]=world
split max limit
[0]=cc
[1]=ss bb

get match part

    import com.github.jeppeter.reext.ReExt;
    public class ReExtTest {
        public static void main(String[] args) {
            ReExt ext = new ReExt("([\\d]+)cc([\\d]+)");
            int maxcnt;
            int i;
            ext.FindAll("33cc55");
            maxcnt = ext.getCount(0);
            for (i=0;i<maxcnt;i++) {
                System.out.println(String.format("[0,%d]=%s",i,ext.getMatch(0,i)));
            }
            System.out.println(String.format("[-1,0]=%s",ext.getMatch(-1,0)));
            System.out.println(String.format("[0,2]=%s",ext.getMatch(0,2)));
        }
    }

result is

[0,0]=33
[0,1]=55
[-1,0]=null
[0,2]=null

Versions

Version
1.0