Replace character if not followed by? 
Author Message
 Replace character if not followed by?

Is it possible (using regular nawk) to replace a character if it is not
followed by another character using regular expressions? -or- any other
method!!

For example:-

in...

xxxabxxxacxxxab

...replace "a" which is not followed by "c" with "r"...

xxxrbxxxacxxxrb

Many Thanks,
   =Adrian=



Sat, 22 Feb 2003 17:43:20 GMT  
 Replace character if not followed by?

Quote:
> Replace all ac by a char-combination  which is not used otherwise.
> Replace all a with r
> Replace char-combination  by ac

Duh, Slap head!!

Thanks. Just can't seem to get my head into gear today!!

Regards,
   =Adrian=



Sat, 22 Feb 2003 18:28:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Issues with Non-COBOL characters and REPLACE / REPLACING

2. string.replace() can't replace newline characters???

3. REPLACE not replacing under Win 95??

4. Replacing 2 end characters

5. Replace a sequence of characters

6. replacing ^M characters with linefeed

7. How to replace characters in a text file

8. Replace character by awk

9. replacing characters

10. Replace Nth Character in a String

11. HowTo? Conditionally replace a single character (TODAY PLEASE)

12. How to Replace a New Line Character

 

 
Powered by phpBB® Forum Software