-3

So I want to remove all text before the colon ":" so example

d016eb66c977d646642d491ae8461134:12345asdf
90ef258293ee214d1128abecd7b96f99:61231afad

To be

12345asdf
61231afad

edit: I've already tried this ^[^:]*: but i ended up with only one line

Toto
  • 89,455
  • 62
  • 89
  • 125
user2227874
  • 31
  • 1
  • 1
  • 9

3 Answers3

0

Use the following with multiline mode enabled:

^[^:]+:

This must be replaced with an empty string, see a demo on regex101.com.

Jan
  • 42,290
  • 8
  • 54
  • 79
0

Instead of ^[^:]*:, use ^.+: because [^:] matches also newline.

Find what: ^.+:
Replace with: NOTHING

Don't check dot matches newline

Edit according to comment:

This will match the last occurrence of : within each line.

If you want to match the first occurrence of : use ^.+?:

Toto
  • 89,455
  • 62
  • 89
  • 125
  • This `^.+:` expression matches from the beginning of a line till the *last* occurrence of `:`. Use `^.*?:` or `^[^:\n]:` to remove up to the *first* `:`. – Wiktor Stribiżew May 13 '16 at 21:19
  • @WiktorStribiżew: You're right, but it is not said in question which `:` must be matched. – Toto May 14 '16 at 10:56
-1

Use [^ ]*: (don't forget to add the space between ^ and ])

Leo Aso
  • 11,898
  • 3
  • 25
  • 46