Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex madness...
#1
Hi

after 2 hours of pulling my hairs off, i decide to ask the master Gintaras, though i'd like to understand why my methods fail.

Easy case : I have files that look like
_s=Name.OfTheFile001
_s=NameOf.The_9File-02
_s=Name.OfThe.File.3

I spend 2 hours trying to remove the LAST digit(s) of the files names.
findrx(_s "^(.*)(\d+)$) 0 0 match 1)

but anyway i try (this is only one example i tried, i tried all methods i could), match variable always only contains 1 digit at the end, where it should be equal to
Name.OfTheFile
NameOf.The_9File-
Name.OfThe.File.

Seems the \d+ which should catch one or more digit (+ sign) does only take the first one.

What did I not understand?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)