chebus
chebus

Reputation: 772

Delete portion of characters from each line in notepad++

I am trying to delete range of characters from each line in notepad

input:

  • 0 0000 Stringxx1 DescribeString1
  • 1 0001 Stringxx2 DescribeString2.

output:

  • Stringxx1
  • Stringxx2

I've gone through this

I could just select the String with spaces however not sure how to proceed further. Note the words starts with String however can be of varying length.

\sString.*?\s

Any help would be appreciated.

Upvotes: 1

Views: 1180

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 626845

You may use

^.*?(String\S*).*

And replace with $1.

Explanation:

  • ^ - start of string
  • .*? - zero or more characters other than a newline but as few as possible before....
  • (String\S*) - (Group 1) a literal character sequence String followed with zero or more characters other than whitespace (\S*)
  • .* - zero or more characters other than a newline (up to the end of a line)

enter image description here

Upvotes: 1

Related Questions