How to write regular expression in LibreOffice?

The table LibreOffice collected the names of the goods, specifying the quantity in the package.

Examples:
product number one with a capacity of 50 ml, packing 60 PCs.
item number two packing 100 PCs
item number three 10pcs.

You need to leave the cells only number of pieces in the package, and everything else to remove that is:
60 PCs
100 PCs
10pcs

Try different regular expressions, but nothing helps.

([^0-9]{1,3}) ([^t-W])
[![0-9]{1,3}[:space:][:lower:]{2}]

Help to write a correct regular expression.
Thank you!
March 23rd 20 at 19:43
1 answer
March 23rd 20 at 19:45
Solution
it goes?
\d* ?PCs
Almost, you only need to remove everything except for this expression. - macie.Wiegand commented on March 23rd 20 at 19:48
@macie.Wiegand,
(.*?)\d+\s?PCs\K\. - Micheal_Run commented on March 23rd 20 at 19:51
@Micheal_Run, thank you, but what works in the service regex101.com does not work in LibreOffice. - macie.Wiegand commented on March 23rd 20 at 19:54
@macie.Wiegandand what exactly is not working? may not the service use? search/replace - Micheal_Run commented on March 23rd 20 at 19:57
@macie.Wiegand, try this
(.*?)[:digit:]+[:space:]?PCs\K\. - Micheal_Run commented on March 23rd 20 at 20:00
@Micheal_Run, 5cfd02e80c961643909741.png - macie.Wiegand commented on March 23rd 20 at 20:03
@macie.Wiegand, Yes, find and replace the void so - Micheal_Run commented on March 23rd 20 at 20:06
@Micheal_Run, need everything except to replace the void - macie.Wiegand commented on March 23rd 20 at 20:09
@macie.Wiegand, try something from this.
(.*?)[:digit:]+[:space:]?PCs\K\.
^.*?(?=[:digit:]+[:space:]?PCs)|\.

And if not, then note it:
^.*?([:digit:]+[:space:]?PCs)\.
And replacement note it:
\1

All the \d and \s I replaced the [:digit:] and [:space:]
If it did not, then this Librarys sooo limited and only a few steps. - Micheal_Run commented on March 23rd 20 at 20:12
@Micheal_Runwins option
^(.*?)(?=[:digit:]+[:space:]?PCs)|\.
Thank you! - macie.Wiegand commented on March 23rd 20 at 20:15
@macie.Wiegand, well, there is the extra pair of brackets that I removed) please. - Micheal_Run commented on March 23rd 20 at 20:18

Find more questions by tags LibreOfficeRegular expressions