Answer the question
In order to leave comments, you need to log in
How to check if a string is a product SKU?
Good afternoon. Has anyone come across a task like: "Determine that string X is a product SKU?". An article is not an article for a specific given range of goods, but an abstract article in a vacuum. Those. article can be:
Answer the question
In order to leave comments, you need to log in
It seems to me that this is impossible to do. The article can be any set of letters and numbers. There is no general coding rule.
The only way I see is to have a database of articles and refer to it.
I would start with an understanding of what article patterns exist in general (maybe they can be segmented by product type, for example, kettles, electric stoves, macbooks).
Create an index on articles and make a selection on this field. This is one of the fastest methods. Another method is to systematize the suppliers and call an article check for each.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question