Regular Expression help

Hi All,

I am new to regular expressions. I need help in replacing few filenames.

We have few filenames like abcd.txt.pgp, 1234.xxx.pgp, 4567.yyy.pgp

I must replace the .txt.pgp from file1, .xxx.pgp from file2 and .yyy.pgp from file3 with nothing

In simple terms, Can anyone of you help removing whatever is present after . (decimal). we have a common framework so the filenames will be input and we must remove whatever present after (.). So, there will be only one replace string service.

Please help.
David

If your file name pattern is always like this “abcd.txt.pgp”. Tokenize the file name with “.” delimiter access 0th element in the sting list and ignore others.

If you want to use a regular expression:

Use the replace “WmPublic:pub.string:replace”
with parameters:

searchString = ..*
useRegex = true

..* = a “.” to match the point and “.*” to match all caracters placed after the point.

Thanks all for your inputs.