@utilx/string
```typescript npm install -D @utilx/string ```
Last updated 2 months ago by lteam .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @utilx/string 
SYNC missed versions from official npm registry.

string-utils

npm install -D @utilx/string

strmod

const { IP } = Pattern.regex
const s = "    ip: 127.0.0.1 1.1.1.1 "
const expect_string = strmod(s).trySkip(IP).replace(IP, "127.0.0.1").dumps()

LineEditor

const fp = "tsconfig.json"
LineEditor.fromFile$(fp)
    .locate(/"target"/).replace(true, false)

const fp = "tsconfig.json"
LineEditor.fromFile$(fp)
    .locate(/"target"/).strmod().trySkip()

r

We provide a magic letter r to provide:

  1. embeded regex patterns
  2. r.or
  3. r

For example, if we want to identify the postcode

r( r(r.INT0_255, ".").l(3), r.INT0_255 )

identify the pairname:

p1: 90, p2: 12, p3: 12
const regex = r(r.name("\w", "name"), /:/, r.name(/\d+/, "score"))
for (let i of regex.visit("p1: 90, p2: 12, p3: 12")){
    console.log(i.group!.name, i.group!.score)
}

Current Tags

  • 0.0.9                                ...           latest (2 months ago)

8 Versions

  • 0.0.9                                ...           2 months ago
  • 0.0.8                                ...           3 months ago
  • 0.0.7                                ...           3 months ago
  • 0.0.6                                ...           3 months ago
  • 0.0.3                                ...           3 months ago
  • 0.0.2                                ...           3 months ago
  • 0.0.1                                ...           3 months ago
  • 0.0.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 8
This Week 8
This Month 9
Last Day 0
Last Week 0
Last Month 0
Dependencies (10)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |