Translation - Μετάφραση

Resources, Technical Assistance and Technology News => Translator resources => Tips on Using Computers => Topic started by: spiros on 04 Oct, 2019, 11:25:55

Title: Regex: Select only the first line
Post by: spiros on 04 Oct, 2019, 11:25:55
Regex: Select only the first line

select only the first line of the text-file
Code: [Select]
^\A(.*)$
Insert any word in the beginning of file:
Search
Code: [Select]
^\A(.*)$Replace with
Code: [Select]
Word $1
Select the last line of the text-file
Code: [Select]
^(.*)$\z
insert word at the end of file
Search
Code: [Select]
^(.*)$\zReplace with
Code: [Select]
$1 Word
Add a new empty line at the beginning of file:
Code: [Select]
^\A(.*)$Replace cu
Code: [Select]
\r \1
Add a new empty line after the first line:
Search
Code: [Select]
^\A(.*)$Replace cu
Code: [Select]
\1 \r (after \r leave an empty space)
https://community.notepad-plus-plus.org/topic/12352/regex-insert-new-line-at-the-beginning-of-file/2