The general term for what you are looking for is Monte Carlo simulations. Although I don't have any personal experience with it, there is a Monte Carlo feature in the Pandas library. In addition, I found pyhmc, pyMC and pyMC3 (which looks like the most up to date).
You could use the http://www.pcre.org/ library.
Please cut our problem into smaller pieces the next time.
If you current issue is a regex question, then it is unneeded information that you fetch this data with wget.
It is easier to focus on your issues if only the relevant information is in the question.
You can use
I have used tesseract (first option) and found that it is quite accurate (not 100% in my case). I directly used trained data for recognition.
You can start with following code.
Tesseract tess = new Tesseract();
tess.setDatapath(tessDataPath); //Path to tessdata ...
I guess you can use DataMelt Java program. You can see samples of the outputs here: https://jwork.org/dmelt/code/index.php?art=Plots/3D
The nice thing about these 3D plots (functions, data) are interactive, and can be saved to the vector graphics