I'm hoping there is an easy solution to my regex replacement problem here. I can seemingly detect fine, it's the use of the found item as a variable in the replacement that's a problem.
I have filenames currently done in camelcase, for example: StaffMeeting.doc
I need to insert underscores between the words identified by the camelcase change, for example: Staff_Meeting.doc
I've pulled a lot of different source from other sites searching for good ways to approach this, and the regex I'm now working with using the regex coach is (((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))
That regex does identify the capitals fairly well (though it also picks up on the beginning capital that I do not want changed), but my problem is that when trying to do a replacement I don't understand how to include the found item in the replacement string. So for example if i just use _ for the replacement string, I get this result:
_taff_eeting.doc
So is there a trick I'm missing that allows me to include the found text from the first regex in the replacement result? Something like:
_<variable>
and is it possible to make my find regex ignore the first character in the string? Thanks in advance for any help and/or nudging in the right direction.
--Kevin