Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al  ·  activity timestamp yesterday

Like global search and replace but don’t like surprises?

Check out serpl – a handy little command-line app that gives you a visual preview of the changes you are about to make. You can even go in and remove the replacements you don’t want from the source previews. The regex support appears to be basic, however (I couldn’t get a negative lookbehind to work).

https://github.com/yassinebridi/serpl#readme

(Also, it appears they’re looking for maintainers. It’s written in Rust.)

#searchAndReplace #findAndReplace #CLI #app #serpl #dev

Screenshot of me serpl with Search, Replace, Result List and Preview panes in a command-line interface. Search has /setup and [Match Case] mode selected, Replace has /settings with [Simple] mode selected. The Results List shows about 20 items and the selected file is shown in the preview pane with three replacements in diff-style red/green highlighting on lines 27, 28, and 35.
Screenshot of me serpl with Search, Replace, Result List and Preview panes in a command-line interface. Search has /setup and [Match Case] mode selected, Replace has /settings with [Simple] mode selected. The Results List shows about 20 items and the selected file is shown in the preview pane with three replacements in diff-style red/green highlighting on lines 27, 28, and 35.
Screenshot of me serpl with Search, Replace, Result List and Preview panes in a command-line interface. Search has /setup and [Match Case] mode selected, Replace has /settings with [Simple] mode selected. The Results List shows about 20 items and the selected file is shown in the preview pane with three replacements in diff-style red/green highlighting on lines 27, 28, and 35.
GitHub

GitHub - yassinebridi/serpl: A simple terminal UI for search and replace, ala VS Code.

A simple terminal UI for search and replace, ala VS Code. - yassinebridi/serpl
  • Copy link
  • Flag this post
  • Block
ilmari
ilmari
@ilmari@social.treehouse.systems replied  ·  activity timestamp yesterday

@aral it uses the rust regex crate, which does not support lookaround or backreferences, because they "are not known how to implement efficiently"

regex - Rust

This crate provides routines for searching strings for matches of a regular expression (aka “regex”). The regex syntax supported by this crate is similar to other regex engines, but it lacks several features that are not known how to implement efficiently. This includes, but is not limited to, look-around and backreferences. In exchange, all regex searches in this crate have worst case `O(m * n)` time complexity, where `m` is proportional to the size of the regex and `n` is proportional to the size of the string being searched.
  • Copy link
  • Flag this comment
  • Block
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al replied  ·  activity timestamp yesterday

@ilmari 🤷‍♂️

(One person’s inefficient is another’s good enough.) ;)

  • Copy link
  • Flag this comment
  • Block
Doaa Madhoun
Doaa Madhoun
@doaamadhoun@mastodon.social replied  ·  activity timestamp yesterday

@aral Please, my child is between life and death. Please repost.

  • Copy link
  • Flag this comment
  • Block

BT Free Social

BT Free is a non-profit organization founded by @ozoned@btfree.social . It's goal is for digital privacy rights, advocacy and consulting. This goal will be attained by hosting open platforms to allow others to seamlessly join the Fediverse on moderated instances or by helping others join the Fediverse.

BT Free Social: About · Code of conduct · Privacy ·
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Code of Conduct