Follow

fun fact about sed

if you need to use a "/" in your pattern and don't want to worry about escaping, you're allowed to just use a different delimiter for the regular expression

like

s|/my/pattern|/my/replacement|g

this will replace "/my/pattern" with "/my/replacement"

@SuricrasiaOnline yes! i only learned about that a few years ago, and it makes life sooo much easier! i often use # as my delimiter

@SuricrasiaOnline I do this ALL the time, since otherwise I have to many /\/ things in there.

: works well for me and is easier for my brain to parse

@SuricrasiaOnline Leaning Toothpick Syndrome (LTS) is a curable disorder!

@SuricrasiaOnline@cybre.space best of all, this feature is copied by most everything that expects a regex.

perl -pC -e'y# !-~
#\N{U+3000}\N{U+FF01}-\N{U+FF5E}#'

Sign in to participate in the conversation
Cybrespace

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!