Socket
Socket
Sign inDemoInstall

com.github.jeppeter:com.github.jeppeter

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.jeppeter:com.github.jeppeter

regular expression extension


Maintainers
1

Readme

Source

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc