-2

I want a regex to extract the text between slashes which contain an equals '='

data/xx/yy/zz/date=20190506/xxx.json

-> date=20190506

dataProcs
  • 55
  • 1
  • 13

1 Answers1

1

Regex not needed.

val str = "data/x=x/yy/zz/date=20190506/xxx.json"  //example string (modified)

str.split("/").filter(_.contains('='))
//res0: Array[String] = Array(x=x, date=20190506)
jwvh
  • 50,871
  • 7
  • 38
  • 64