I want regex for the given sentence to pull just character till 332.5 million units starting from Recalled units

1 次查看(过去 30 天)
4 StericycleExpertSolutions.com Pharmaceutical recalls increased 52% to 105 – the highest since Q3 2013 and the third highest since at least 2005. Recalled units jumped more than 100 times to nearly 332.5 million units – the highest quarter by far since Q2 2007 and second highest since 2005. This is mostly due to one large recall. CONNECTING THE DOTS 1. Failed specifications made up the top cause of recalls for the seventh consecutive quarter. 2. 84 companies reported at least one recall in Q1 2018 – the highest number since at least 2012. 3. Class I recalled units increased for the second quarter in a row – this time by 192.8%. There were more than 1 million Class I recalled units in Q1 2018 – higher than any quarter from 2016 and three of the quarters in 2017. OF PHARMACEUTICAL RECALLS WERE NATIONWIDE % OF PHARMACEUTICAL UNITS BY CLASS PHARMACEUTICAL RECALLS & UNITS 79% TOP PHARMACEUTICAL CAUSES BASED ON RECALLS Largely due to one large recall, the top cause based on units was Current Good Manufacturing Practice (CGMP) deviations, at 94.7% of recalled units. OUT OF PRACTICE Failed Specs 21.9% Sterility 15.2% Mislabeling 14.3% Foreign Materials 11.4% Subpotency 9.5% Class II 97.8% Class III 1.3% Unclassified 0.6% Class I 0.3% 60 80 140 20 40 120 100 150MM 100MM 50MM 250MM 200MM 350MM 300MM Q1 2017 Q2 2017 Q3 2017 Q4 2017 Q1 2018 Q1 2016 Q2 2016 Q3 2016 Q4 2016
I am using this regexp given below but not able to resolve
recall_data=regexp(pdf_text,(':?Recalled units .*? to \w* [0-9]*+\.*[0-9]*||:?[0-9]*% to ?\w*+\s*+\w* [0-9]*+\.*[0-9]* ?\w*'),'match')

采纳的回答

Cris LaPierre
Cris LaPierre 2018-12-29
编辑:madhan ravi 2018-12-29
It seems to work, though it returns 2 matches. I think the second one if the one you want ?
recall_data =
{'52% to 105 '} {'Recalled units jumped more than 100 times to nearly 332.5'}
If you just want the 2nd match, your regexp can be simplified to the following
recall_data=regexp(pdf_text,':?Recalled units .*? to \w* [0-9]+\.*[0-9]','match')
  4 个评论
Cris LaPierre
Cris LaPierre 2018-12-31
You're creating a moving target...
You've updated the text but not the question. The code I provided earlier still answers your question - it gives you the text from 'recalled' to '332.5'.
Could you be more specific on what you want it to do? Easiest is if you show us what your expected output is and what code you've tried, along with a description of why its output is incorrect.

请先登录,再进行评论。

更多回答(1 个)

dfaeaser aseraweraw
dfaeaser aseraweraw 2018-12-29
GREAT

类别

Help CenterFile Exchange 中查找有关 QSP, PKPD, and Systems Biology 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by