I am working on a pdf file conversion. I need to replace the original amount value with some other value for safety purpose. But while parsing the pdf file into normal text file, all the contents are brought together in a single line.So during the parsing I am appending some symbols like "~~" in every line end (\n).Now the problem is characters like "~~" might come in any part of the page content after parsing.So I need answer to perform regex in this content. But need to ignore the char "~~" in the page.
Eg: The string "12" might be like any of the ones shown below.
12
12~~
1~~2
1~~2~~
~~12
~~12~~
~~1~~2
~~1~~2~~ -->Just permutations of the string with this character. So I want a regex that matches the string "12" despite the permutation or just to ignore the character "~~".
I want to know how to ignore that character, not remove it.
Hi People, What I gave there was an example with the string "12" to make you understand the situation. The answer below would surely fulfil the requirement for the example I gave, but thats not what I actually meant...The contents will vary for every pdf, and the content of the pdf is HUGE!!! Even If i know the content of the whole pdf, just assume how many places can I insert the (?:~~)? into :(!!!