2

Suppose I have the following text in Textpad:

kwejkewrjl:ksajdlakj

e833ekjh:skdjkahak

2098e123809:ksjdkas

dkjwhfdkjqhio:skjddksjal

98a09asfdsaok:kwqjeo912ui

I would like to remove all characters from each line that occur after the colon. The new text should be:

kwejkewrjl:

e833ekjh:

2098e123809:

dkjwhfdkjqhio:

98a09asfdsaok:
user1729506
  • 975
  • 4
  • 15
  • 28
  • In notepad++ I would just find `:.*` and replace with `:`, make sure `regular expression` is checked and `. matches newline` is not checked. Perhaps textpad works similarly? – Smern Sep 17 '13 at 19:43
  • finding `:[^\n\r]*` and replacing with `:` should be pretty fail-proof regardless of DOTALL. – Smern Sep 17 '13 at 19:54

1 Answers1

5

How about this?

Find:

:.*

Replace with:

:

Just did this in TextPad on one of my servers.

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
Leptonator
  • 3,379
  • 2
  • 38
  • 51
  • Most helpful of these types of questions I've seen thus far! I had to replace `,,XX/` pattern where `XX` could be any number, and this enabled me to figure out that `,,.*/` would do the trick. The brackets make it rather complicated when starting out with these... – gktscrk Jul 23 '20 at 16:23