I have millions of strings from different sources that tend to exhibit some common patterns. Is there a way to extract these common motifs?
For example, in a list (of millions) that includes strings
..is there a way to extract the following patterns?
- 'rs' plus one or more digits
- 'sxs-rs' plus one or more digits
- 'kgp' plus one or more digits
Some other parameters:
- cleaning up beforehand isn't an option
- some manual tweaking would be possible (e.g. manually changing a pattern because of outside knowledge)
- exceptions (i.e. classifying less than 100% of the strings) can be tolerated
- an ideal solution would be using a built-in python library.