Delete two line

Hello, as I just did not try, I read here a bunch of topics, nothing happened, help please.
We take from the clipboard code:
width: 425px
height: 83px
color: #252b43
font-family: Proxima1
font-size: 44px
font-weight: 300
line-height: 44px

And you need to remove the first 2 lines completely, and back to the clipboard, you will get:

color: #252b43
font-family: Proxima1
font-size: 44px
font-weight: 300
line-height: 44px

P.S. it reached the point that the clipboard was displayed correctly, but when you inserted text into any program it was wrong
(me use google translate)

This should do it. Make sure you have Keyboard Maestro version 8.0.3 or later, as there have been a few issues with the Search & Replace in 8.0.0-2.

Search and Replace.kmactions (467 B)

1 Like

Since the \A anchor is NOT accepted by all regex engines, I don't like to use it. It doesn't show up in many RegEx tutorials.

So I prefer the more compatible and common ^ for start of line:
^.*\n.*\n

See Start of String and End of String Anchors

I prefer \A because it has a defined meaning of “the start of the string”. So when that is what I mean, that is what I use.

^ can vary in meaning to mean either the start of the string or the start of the line, so I use it when there is more than one line, I prefer to use \A.

Similarly, $ means something different to \z and \Z.

1 Like

Good point.
Of course, unless there is a (?m) for multiline, then ^ also means start of string.

I switch so much between KM and JavaScript RegEx, I try to keep things simple for my feeble memory. :wink: