I have a huge String where i need to replace
Pattern A to pattern B
Pattern C to Pattern D
pattern E to pattern F
like 5 or 6 time i have to replace some part of the string.
If i do a direct string operation to replace those one by one, it takes huge Heap space.
Like replaceAll().replaceAll().replaceALL
pattern.compile("(pattern a|patternc)"); wont he me bcoz we can only replace this types of pattern with 1 parrten x.
What could be a memory efficient way to do this replacement.
Does regex have any way to accomplish this?