Regular Expressions not working OK for me
Posted: Tue Aug 09, 2005 3:31 pm
Hi,
I have a file where I differentiate between strings and characters such that strings are delimited by double quotes and characters are delimited by single quotes. Not too tricky and kind of standard. For example "String" versus 'S'.
I wanted to change every occurance of '*'. to "*". and then change "." to '.'. I thought Regular Expressions would do this for me but, in both cases I got more than I bargained for. In the first '*' to "*", I got "*"String' instead of "String" (obviously I started with 'String') and in the second case, "." to '.', I got '.' instead of 'S'. I've worked around the problem - actually I used another editor I own that supports the same concepts - but I'd rather stick to TextPad if I could.
I am very willing to have someone tell me what I'm doing wrong, but I didn't find anything when I looked through old resources. Yes I DID cause the Regular Expression check mark to appear when doing the replace. I am using TextPad 4.7.3.
Thanks,
Doug Ray
I have a file where I differentiate between strings and characters such that strings are delimited by double quotes and characters are delimited by single quotes. Not too tricky and kind of standard. For example "String" versus 'S'.
I wanted to change every occurance of '*'. to "*". and then change "." to '.'. I thought Regular Expressions would do this for me but, in both cases I got more than I bargained for. In the first '*' to "*", I got "*"String' instead of "String" (obviously I started with 'String') and in the second case, "." to '.', I got '.' instead of 'S'. I've worked around the problem - actually I used another editor I own that supports the same concepts - but I'd rather stick to TextPad if I could.
I am very willing to have someone tell me what I'm doing wrong, but I didn't find anything when I looked through old resources. Yes I DID cause the Regular Expression check mark to appear when doing the replace. I am using TextPad 4.7.3.
Thanks,
Doug Ray