Sublime Forum

Hi, Selection tip

#1

Well, How can I Select the whole sentence but the last character with the find tool?
Ty!

0 Likes

#2

Example?

input =?
output =?

2 Likes

#3

If your sentences always end with a ., ?, or !, you could do something like this: [\s\S]+?(?=[.?!]) for a first sentence, or prepending a lookbehind if you want sentences after the first one. (?<=[.?!] ).

1 Like

#4

For example:
"asdasdasd
asdasdasd
asdasdasd
asdasdasd
"
the output:
"d
d
d
d
"

0 Likes

#5

Thank you!

0 Likes

#6

Oh if they’re lines, that’s even easier, then. You can either do what you started with by selecting ^.+(?=.$) and deleting it, or you can find ^.+(.)$ and replace with \1.

1 Like

#7

Or ctrl+a, ctrl+shift+l, end, left arrow, shift+home, delete. (not on macos)

Make sure to have soft wrapping disabled.

1 Like