0

im working in a omake file and have a string represented a path. I'm trying to remove the first directory.

this is my string:

PATH = \PI\Common\noa\common\util 

i wrote this regex:

$(PATH,S/.+\\\(.*\)/\1/)

but the result is util. While what I want to receive is this string : \Common\noa\common\util

i tried using "?" for being not greedy but it doesn't work here (omake file)

someone knows how to do it?

Rohit Jain
  • 209,639
  • 45
  • 409
  • 525

1 Answers1

0

If the non-greedy modifier doesn't work in omake, you can always explicitly prevent the backslash from matching in your "get everything up to the second backslash" expression:

\\[^\]+\(.*\)

I don't know if the brackets have to be escaped in omake, but you get the idea...

Desidero
  • 231
  • 1
  • 9