devops
devops

Reputation: 1201

Reg exp match until first occurence of a slash

Input :IndicesQA-agg-calculation-ci/USAggModule:USAggTestCalcEngine

Output should be : IndicesQA-agg-calculation-ci

I have tried IndicesQA-.*[^/] , but it does not work

Upvotes: 0

Views: 32

Answers (2)

Zenoo
Zenoo

Reputation: 12880

You can use ([^\/]*)\/.

$1 will give you what you want.

Upvotes: 0

Micha Wiedenmann
Micha Wiedenmann

Reputation: 20843

You are looking for IndicesQA-[^/]*.

Upvotes: 1

Related Questions