Python Forum

Full Version: Can python be used to search a word document for combinations of 6 digits?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good morning, sorry I am new to python, but I think it could help me with a problem. I have a word/notepad document that I need to search for 6 digit combinations that already exist in the document. Does anyone know if you can use python for this and if so does anyone have an example script I could use/copy/modify?

thank you,

gk
It can certainly be done. The best way to do it would be to save it as a plain text document, read the document in and use the re module's findall to do a regular expression search for the regex '\d\d\d\d\d\d'.
thank you!

gk