On The Value Of Tactics With Powershell's Multiple Find And Replace Oneliner

1. multi-replacer

  • I have a URL and for a case, it arrives copied from a browser, I need to remove both parts of the beginning and end
  • I have two cases so I employ a ternary operator for the little case analysis
  • I also natural line continuators for better readability
  • use parenthesis to make multiple operations with -replace
  • it would work also without "" within the command, but I prefer Python's
Explicit is better than implicit

2. links

--

--

--

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Leetcode — Decode Ways

Custom Android XML Lint Rules with Kotlin

Optimising any HTML5 playable within Luna Playground

Do you want to get NFT for free? Do you want to participate in EMIT to get LGHT?

Hosting a Secure Website on EC2 with GoDaddy Domain and SSL Certificate

Terraform Best Practices: 5 Pieces of Advice for DevOps

Rethinking Testing Through Declarative Programming

A sailboat on the open sea.

Hadoop Distributed File System (HDFS)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

More from Medium

Using Subexpressions Within Strings In Powershell

General Bash Usage — 2 (Grep-Awk)

Java Development Kit(JDK) Installation and Deletion on Linux

Understanding C Static Libraries