Re: String Replace only if whole word?

2006-11-19 Thread Leonhard Vogt
Michael Yanowitz schrieb: > Yeah, I am operating this on a Python script. However, I am working off > a requirement that the script be pre-processed and the strings replaced > before executing the script and that if there are any remaining (not > replaced) > names that I don't execute the script

Re: String Replace only if whole word?

2006-11-17 Thread Tim Chase
> I have been using the string.replace(from_string, to_string, len(string)) > to replace names in a file with their IP address. > For example, I have definitions file, that looks something like: > 10.1.3.4 LANDING_GEAR > 20.11.222.4 ALTIMETER_100 > 172.18.50.138 SIB > 172.18.50.138 LAPTOP >

RE: String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
>Michael Yanowitz wrote: >> Hello: >> >> I am hoping someone knows if there is an easier way to do this or someone >> already implemented something that does this, rather than reinventing the >> wheel: >> I have been using the string.replace(from_string, to_string, len(string)) >> to replace na

Re: String Replace only if whole word?

2006-11-17 Thread Juho Schultz
Michael Yanowitz wrote: > Hello: > > I am hoping someone knows if there is an easier way to do this or someone > already implemented something that does this, rather than reinventing the > wheel: > I have been using the string.replace(from_string, to_string, len(string)) > to replace names in a

String Replace only if whole word?

2006-11-17 Thread Michael Yanowitz
Hello: I am hoping someone knows if there is an easier way to do this or someone already implemented something that does this, rather than reinventing the wheel: I have been using the string.replace(from_string, to_string, len(string)) to replace names in a file with their IP address. For ex