Page 1 of 1

regular expression: Remove all characters except a word

Posted: 2012-06-01 11:47:09
by otreux
Hi:)
I have this problem, I have many fine that have long name, I want delete all except a word. For example:

actual name:
new:bin, archive2012Mary

new name that I want:
Mary

Is possible?

Posted: 2012-06-01 22:48:00
by antp
Hi,
What is the criterion for defining the word to keep?

Posted: 2012-06-02 08:07:14
by otreux
there isn't a criterion :(
Usually is the last word (and sometime it have another word attached), but in some documents in the middle

Posted: 2012-06-02 10:05:29
by antp
Well if there isn't a rule, how could it be "programmed"? :??:

Posted: 2012-06-03 13:50:28
by otreux
im not expert abut the regualr expression. I have request if is possible remove all the caracters without a word :)

Posted: 2012-06-03 20:51:47
by antp
Depends what is the rule for the "a word".
The last one? Yes.
"Not always the last one"... more difficult :D