I need to find a rather long string for CPV codes (general purchases).
I'm currently doing this with simple loops and str.find ()
the problem is that if the CPV code was specified in a slightly different format, this algorithm will not find it.
What is the most efficient way to find all the different iterations of code within a string? Is this just a case of reformatting each of up to 10,000 CPV codes and using str.find () for each instance?
An example of various formatting may be as follows:
30124120-1
301241201
30124120 - 1
30124120 1
30124120.1
and etc.
Thank:)
source
share