A
A
Atraides2018-06-18 12:24:30
Regular Expressions
Atraides, 2018-06-18 12:24:30

How to remove all characters up to and including the hyphen?

Good afternoon, please tell me in what ways you can do the following:
there is an expression TCM-K1705006 pc-21705003.zkv I need to cut it as a result of K1705006 pc-21705003.zkv,
here you need the expression to either delete all characters up to the first hyphen inclusive, or just delete the first 4 characters at the beginning of the line, clambered all over the Internet found only how to delete after the character, for example / ^ ([^-] +) - /.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Androgen13, 2018-06-19
@Androgen13

like this (?<=(-)).*?.zkv

A
Atraides, 2018-06-19
@Atraides

Androgen13 thanks for the answer, in reg. the calculator seems to work, but it didn’t work in Grafana (as I understand it, there is a hyphen limit, maybe an option with deleting the first 4 characters? but I don’t know how to write it (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question