gpt4 book ai didi

javascript - 关于一些多项选择题的正则表达式和 JavaScript

转载 作者:行者123 更新时间:2023-12-01 02:52:36 26 4
gpt4 key购买 nike

我正在尝试解析 Anki 抽认卡多项选择题的 .docx。

我想从 docx 中组合出“问题”和“答案”的匹配组。

在尝试做问题时,我无法让正则表达式以我想要的方式匹配每个问题。

示例问题:

    1.  Hormones and other signal molecules bind with ____ affinities to their receptors and are produced at concentrations ____ their KD values.
a.
low; far above
b.
moderate; far above
c.
moderate; equivalent to
d.
high; far below
e.
very high; equivalent to


ANS: E

2. Steroid hormones, such as glucocorticoids, effect their action by:
a.
binding to a plasma membrane receptor, which stimulates a signal transduction pathway within the cell
b.
binding to a plasma membrane receptor, which stimulates the receptor to enter the cell
c.
entering into the cell and affecting the production of secondary messengers
d.
entering into the cell and then acting as transcription regulators
e.
both a and d are correct


ANS: E

3. All are unifying features of polypeptide hormones EXCEPT that they are:
a.
originally synthesized with signal sequences.
b.
synthesized as inactive preprohormones.
c.
activated from preprohormones to hormones by phosphorylation.
d.
may produce several different peptide hormones with suitable processing.
e.
all are true.


ANS: C

4. Each of the following statements is true EXCEPT:
a.
epinephrine is an amino acid derivative
b.
steroid hormones can enter cells and regulate transcription
c.
insulin is a polypeptide hormone
d.
progesterone is a polypeptide hormone
e.
all of the above are true


ANS: D

5. The acrosome reaction, involving ion channel induced release of acrosomal enzymes used by sperm to attack the egg, is induced by:
a.
estrogen.
b.
testosterone.
c.
dihydrotestosterone (DHT).
d.
progesterone.
e.
cortisol.


ANS: D

我正在使用 /(\d.)[^\d][^ANS$]+/gm 但它在解析整个文档时不断跳过第二和第三个问题以及更多问题.

如有任何建议,我们将不胜感激。

最佳答案

如果您只想选择问题,则只需使用:

/\d.+/gm

如果您想选择每个问题及其答案,您可以使用:

/\d\D+(?=ANS)/gm

这是假设问题和答案中不包含数字。

关于javascript - 关于一些多项选择题的正则表达式和 JavaScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46878221/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com