0

How do I select in between characters?

Turn this.

11144552222/questions/ask

Into this.

11144552222//ask

  • 2
    Your title says "delete", the body of the questions says "select". Please edit your question and clarify what you mean. – DavidPostill Sep 4 '15 at 20:07
  • Are you wanting to do this throughout an entire document? – DrZoo Sep 4 '15 at 20:10
  • Do you want to delete everything that appears between two slashes? Only if it includes no spaces? Just after the second slash? Only after a number followed by a slash? It's not entirely clear what you want. Providing a few examples and brief explanation of what you'd like to achieve will help you get the most useful answer. – Excellll Sep 4 '15 at 20:13
1

Double-click the word questions to select only that word - then simply press Delete or Backspace to delete it.

If you want to do it for an entire document, you can use a regular expression to achieve the result you want:

  1. Press Ctrl+ H to bring up the Replace dialog
  2. Enter /.*/1 in the Find what textbox and enter // in the Replace with textbox just below
  3. Select Regular expression under Search Mode. Make sure . matches newline is not checked.

1If your input string contains more than two slashes, you may want to use either /.*?/ or /[^/]+/ instead, depending on which result you want.

enter image description here

  • I think he is saying he wants to do this multiple times in an entire document. The solution you gave is well....obvious. – DrZoo Sep 4 '15 at 20:11
  • 2
    To be safe you should use /.*?/ (non-greedy match) to avoid issues when if the lines contain 3 / characters. – DavidPostill Sep 4 '15 at 21:21
  • 1
    Or /[^/]+/ will also accomplish that. – Paul Sep 4 '15 at 21:45
  • Thanks for your inputs, I've updated my answer accordingly. – FastEthernet Sep 4 '15 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.