Skip to content

Global search & replace can't match a whole line #18671

Closed

Description

@BillDenton
  • VSCode Version: Code 1.8.1 (ee428b0, 2016-12-19T14:49:23.350Z)
  • OS Version: Windows_NT ia32 6.1.7601
  • Extensions:
Extension Author Version
read-only-indicator alefragnani 0.4.0
alignment annsk 0.3.0
Doxygen bbenoist 1.0.0
python donjayamanne 0.5.6
EditorConfig EditorConfig 0.3.4
vscode-great-icons emmanuelbeziat 1.1.38
matlab Gimly81 0.4.0
status-bar-tasks GuardRex 0.1.2
vscode-dimmer hoovercj 2.1.0
docthis joelday 0.3.9
cpptools ms-vscode 0.9.3
vscode-clearcase OpenNingia 1.4.1
vscode-icons robertohuertasm 7.0.1
theme-cyanicpastels SamuelLampa 0.0.9
indenticator SirTori 0.2.1
vscode-hexdump slevesque 1.1.4
code-spell-checker streetsidesoftware 0.14.6
comment-snippets Tobiah 0.2.0
dark-plus-material vangware 0.1.4
change-case wmaurer 1.0.0
highlight-trailing-white-spaces ybaumes 0.0.2

Steps to Reproduce:
I what to search for the whole of a line and replace it with nothing, i.e. delete that line.

  1. Searcher whole-line-text and leave replace entry blank.
  2. Matches the line, but replace leaves a blank line.

Tried appending \n to search string. Doesn't match anything.
Tried turning on regular expressions and appending "$" and end of search string. This only matched again one file, where as without "$" it matched lots of files. Doing a replace on this file still left a blank line.
Putting ^ at the start of the line matched lots of files, but replace left a blank line.
How do I get the whole of line matched so I can remove it completely?
Thanks.

Activity

  1. added
    search
    on Jan 18, 2017
  2. BillDenton commented on Jan 18, 2017

    @BillDenton
    Author

    I've got a similar problem in single file search (Ctrl+F). I want to completely remove a string. So I leaving the replace box empty, and press either of the replace button (current one or all). Nothing happened. This is using the insiders build. I'll raise another issue.

  3. BillDenton commented on Jan 18, 2017

    @BillDenton
    Author

    Just checked the release build (1.8.1) and it works.

  4. BillDenton commented on Jan 18, 2017

    @BillDenton
    Author

    I've added another issue (#18711) for the single file search issue.

  5. sandy081 commented on Feb 27, 2017

    @sandy081
    Member

    This needs Multi-line search support #13155

  6. added
    feature-request
    on Feb 27, 2017
  7. roblourens commented on Sep 22, 2018

    @roblourens
    Member

    This would come with #13155

  8. added
    *duplicate
    on Sep 22, 2018
  9. locked and limited conversation to collaborators on Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    *duplicatefeature-requestsearch

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions