Page 1 of 1

Finding the second occurence

PostPosted: Sun Sep 01, 2013 5:10 pm
by TFerguson
How do I find the second occurrence of a character in the file name? In this case, I'm trying to replace the second occurrence of a 'space' with the character '~'.

TIA, TF

Re: Finding the second occurence

PostPosted: Tue Sep 03, 2013 11:09 am
by Stefan
TFerguson wrote:How do I find the second occurrence of a character in the file name? In this case,
I'm trying to replace the second occurrence of a 'space' with the character '~'.

TIA, TF


Perhaps

Repl.(3)
Replace: ##
With: #~



?


Please wait a few seconds then submit. Thank you.

Replace 2nd occurence of Space

PostPosted: Sun Sep 08, 2013 3:49 am
by truth
Another solution using 1RegEx:
(.+? ])([^ ]*) (.*)
\1\2~\3

Group1 = everything until the 1st space
Group2 = everything except space (so that NextSpace must be the 2nd)
Group3 = everything after that 2nd space

If you'd rather not replace 2nd-space in SpaceSpace, change * in Group2 to +