Vim regular expression find and replace

NU113R

I have to find words which are having this pattern:

File{some numeric characters}=  

Example: File1=, File234=, File3456= and delete them.

This is the line:

File1=/media/sda5/  

now I have to replace this line with:

/media/sda5/  

Since I am new to vim, So if anyone can help me

romainl

This command should do what you want:

:%s/File\d\+=//g

:%s/         perform substitution on each line in the buffer
File\d\+=    matches 'File' followed by one or more digits until the first '='
//           deletes the matched text
g            do that on every match on the line

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Vim regular expression find and replace

From Dev

Using regular expression with find&replace in vim

From Dev

Find and replace regular expression

From Dev

Regular expression - Find and Replace in Dreamweaver

From Dev

Find and replace "[" and,or "]" using regular expression in PHP

From Dev

Regular expression to find and replace wrong quotation marks

From Dev

Find regular expression string and replace it in R

From Dev

Can this find/replace be done with a single regular expression?

From Dev

Using Notepad++ find and replace with regular expression

From Dev

Find and replace with two strings between it with regular expression

From Dev

Regular expression find and replace to wrap tags

From Dev

Find and replace "[" and,or "]" using regular expression in PHP

From Dev

Regular Expression for Find and Replace in Microsoft Word

From Dev

Regular expression find and replace in Adobe Dreamweaver

From Dev

Find and Replace in Notepad++ - Regular Expression

From Dev

Find an replace Guid to binary equivalent with regular expression

From Dev

Regular expression find replace on some condition

From Dev

Regular expression to find and replace wrong quotation marks

From Dev

Javascript Regular Expression Find and Replace Issue

From Dev

Find and replace with regular expression in Sublime Text 2

From Dev

Python - LibreOffice Calc - Find & Replace with Regular Expression

From Dev

Vim - incremental numbering via regular expression search and replace

From Dev

Vim: Replace regular expression match on a line with another regular expression match from same line

From Dev

Vim regular expression for backslash

From Dev

Regular Expression in Vim

From Dev

Regular expression substituion vim

From Dev

Find and replace using regular expression, group capturing, and back referencing

From Dev

Find & replace url to HTML tag using regular expression

From Dev

python regular expression find and replace html tag with specific attribute value

Related Related

  1. 1

    Vim regular expression find and replace

  2. 2

    Using regular expression with find&replace in vim

  3. 3

    Find and replace regular expression

  4. 4

    Regular expression - Find and Replace in Dreamweaver

  5. 5

    Find and replace "[" and,or "]" using regular expression in PHP

  6. 6

    Regular expression to find and replace wrong quotation marks

  7. 7

    Find regular expression string and replace it in R

  8. 8

    Can this find/replace be done with a single regular expression?

  9. 9

    Using Notepad++ find and replace with regular expression

  10. 10

    Find and replace with two strings between it with regular expression

  11. 11

    Regular expression find and replace to wrap tags

  12. 12

    Find and replace "[" and,or "]" using regular expression in PHP

  13. 13

    Regular Expression for Find and Replace in Microsoft Word

  14. 14

    Regular expression find and replace in Adobe Dreamweaver

  15. 15

    Find and Replace in Notepad++ - Regular Expression

  16. 16

    Find an replace Guid to binary equivalent with regular expression

  17. 17

    Regular expression find replace on some condition

  18. 18

    Regular expression to find and replace wrong quotation marks

  19. 19

    Javascript Regular Expression Find and Replace Issue

  20. 20

    Find and replace with regular expression in Sublime Text 2

  21. 21

    Python - LibreOffice Calc - Find & Replace with Regular Expression

  22. 22

    Vim - incremental numbering via regular expression search and replace

  23. 23

    Vim: Replace regular expression match on a line with another regular expression match from same line

  24. 24

    Vim regular expression for backslash

  25. 25

    Regular Expression in Vim

  26. 26

    Regular expression substituion vim

  27. 27

    Find and replace using regular expression, group capturing, and back referencing

  28. 28

    Find & replace url to HTML tag using regular expression

  29. 29

    python regular expression find and replace html tag with specific attribute value

HotTag

Archive