How to remove all text but the last 3 characters

后端 未结 1 568
滥情空心
滥情空心 2021-01-17 04:29

I want to remove all text except the last 3 characters. So, for example if I have:

783223748foo
blahblahI\'m
sfdhello

It should become:

相关标签:
1条回答
  • 2021-01-17 05:18

    You may try the following find and replace:

    Find:

    ^.*(?=.{3}$)$
    

    Replace:

    (empty string)
    

    The pattern ^.*(?=.{3}$)$ matches the entire line, but will then pause before consuming the final three characters in the line. The lookahead (?=.{3}$) ensures that the final three characters will not be replaced.

    0 讨论(0)
提交回复
热议问题