Coder Social home page Coder Social logo

rt's Introduction

rt - Regex-based Text Extraction Utility

rt is a command-line tool written in Rust designed to make text extraction a breeze using regular expressions and capture groups. Unlike traditional utilities like rg, grep, awk, or sed, rt focuses specifically on simplifying text extraction tasks, providing a straightforward and intuitive interface for regex-based text processing.

Features

  • Regex-based Extraction: Use regular expressions and capture groups to extract specific text patterns effortlessly.
  • Simplicity: Designed for ease of use, providing a straightforward and clear syntax for text extraction.
  • Rust-Powered: Built with Rust, rt offers performance, safety, and reliability.

Installation

From Source

  1. Ensure you have Rust installed. If not, install it from Rust's official website.
  2. Clone the rt repository:
git clone https://github.com/ThatXliner/rt.git
  1. Navigate to the rt directory and build the tool:
cd rt
cargo build --release
  1. Once built, the executable will be located at ./target/release/rt.

Usage

Examples:

Extract email addresses from a file:

rt '([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})' file.txt --doc

Extract phone numbers from a string:

echo "Contact: 123-456-7890, 987-654-3210" | rt '(\d{3}-\d{3}-\d{4})' 

Getting the folder names of tarballs:

ls | rt '(.+?)\.tar\.gz' --group 1 

FAQ

Why rt?

rt stands out for its simplicity and focus on text extraction via regex capture groups. It provides a more streamlined and intuitive experience compared to other command-line tools, making text extraction tasks more accessible and manageable. It aims to offer a clear and easy-to-understand syntax without the complexities often associated with Perl on the command line.

What's with the name?

It is a Rust rewrite of Ret, with a better interface.


Feel free to contribute, report issues, or suggest improvements by visiting the rt GitHub repository. Your feedback is valuable!

rt's People

Contributors

thatxliner avatar

Watchers

 avatar  avatar

rt's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.