Page 1 of 1

Find 3rd colon in a string?

Posted: Wed Oct 19, 2011 1:14 am
by Susan G
Hi-

I need to change a number of timestamps so that the final separator is a period instead of a colon.

So eg.
0:00:01:14

becomes
0:00:01.14

I haven't been able to come up with the correct RE syntax to find the 3rd colon. Any help would be very much appreciated!

Thanks-

-Susan

Posted: Wed Oct 19, 2011 8:15 am
by ben_josephs
Here is one way to do it:

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: \<([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}+):([0-9]+)
Replace with: \1.\2

[X] Regular expression

Replace All

Posted: Wed Oct 19, 2011 8:36 am
by ak47wong
Here is another:

Find what: ([0-9]:[0-9][0-9]:[0-9][0-9]):([0-9][0-9])
Replace with: \1.\2

Posted: Wed Oct 19, 2011 5:03 pm
by Susan G
Thank you both very much for the quick replies!

-Susan