Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

textgrep

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textgrep

Extract multiline regex matches from text.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

textgrep

NPM version

Usage

usage: textgrep [OPTIONS] PATTERN [FORMAT] [FLAGS]

  textgrep can be used to extract regex matches from a string.

  Unless -f is specified the text will be read from stdin.

  PATTERN
  Specifies the regex you wish to match and capture.
  Follows the JavaScript RegExp syntax, see
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
  Use [^]*? to match any character over multiple lines.

  FORMAT
  Specifies the format to output the captured groups.
  You can use {#} to reference a group where # is the index.
  Escapes (like \n, \t) are allowed.
  Default: {1}\n

  FLAGS
  Specifies the regex flags (see MDN).
  Default: gm

  OPTIONS
  -f=FILE:     will read the text from the given file.
  --:          stops evaluation of options
               (allows the PATTERN to start with -)
  --?|--help:  shows this help screen.

Sample:
  man ls | col -bx | textgrep '^     -(\w+)\s+([^]*?)^$' '   -{1} means: {2}\n\n'

Install from npm

npm install textgrep -g

API

see lib/textgrep.js

Keywords

FAQs

Package last updated on 29 Apr 2016

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc