I would like to limit the matches to matches that are at least 5 characters long. The regular expression selects words that are combination of letters and numbers:
[A-Za-z0-9-]*([a-zA-Z-]+[0-9-]+|[0-9-]+[a-zA-Z-]+)
So for instance on text '3D and also P315 or P35600 and 077333C-0320-PO-3633-001-PME033 3 times 45 is 4D45' it gives 5 matches:
match1: 3D,
match2: P315,
match3: P356000,
match4: 077333C-0320-PO-3633-001-PME033
match5: 4D45.
I have tried this expression so that the matches are P356000 and 077333C-0320-PO-3633-001-PME033 only because they are matches longer than 5 characters:
([A-Za-z0-9]*([a-zA-Z-]+[0-9]+|[0-9]+[a-zA-Z-]+)){5,}
but it does not work.
Any idea how to do that?
And how to simply withdraw the matches from the original sentence?