import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "@((?:(?!@).)*)@((?:(?!@).)*)";
final String string = "Define the term \"affect\"{The external expression of mood}Mood Disorders were previously known as:{Affective Disorders}True or False:\n\n"
+ "Bipolar 1 disorder is one of the most genetically determined disorders in psychiatry.{True}In Bipolar 1 disorder, @[manic or depressive?]@ episodes predominate in @[youth]@.{Manic}In Bipolar 1 disorder, @[manic or depressive?]@ episodes predominate in @[later years]@.{Depressive}Another name for @anhedonia@ is @__________________ depression@{Endogenomorphic}What is the most consistent abnormality observed on CT/MRI in @depressive disorders@?{Increased frequency of abnormal hyperintensities in subcortical regions, especially the periventricular area, basal ganglia, and thalamus}The most consistent abnormality observed on CT/MRI in @depressive disorders@ are increased frequency of abnormal hyperintensities in subcortical regions, especially the:{- Periventricular area\n"
+ "- Basal ganglia\n"
+ "- Thalamus}Common side effects of Lithium include:{- GI disturbances\n"
+ "- Nephrotoxicity\n"
+ "- Hypothyroidism\n"
+ "- Tremors\n"
+ "- Leukocytosis\n"
+ "- Acne\n"
+ "- Psoriasis flares\n"
+ "- Hair loss\n"
+ "- Edema}Which laboratory tests should be obtained before starting patients on Lithium:{- TSH\n"
+ "- Creatinine\n"
+ "- Pregnancy test}What ratio of patients with acute depression will experience recurrences?{3/4}Serotonin neurons project from the brainstem dorsal raphe nuclei to the:{- Cerebral cortex\n"
+ "- Hypothalamus\n"
+ "- Thalamus\n"
+ "- Basal ganglia\n"
+ "- Septum\n"
+ "- Hippocampus}Where do serotonin neurons project from?{Brainstem dorsal raphe nuclei}Acute stress @[increases or decreases]@ serotonin release{Increases}Chronic stress eventually _____________ serotonin stores{Depletes}Chronic stress may also increase synthesis of @[what serotonin autoreceptor?]@ in the dorsal raphe nucleus{5-HT 1A}Elevated glucocorticoid levels tend to @[enhance or reduce?]@ serotonergic functioning{Enhance\n\n"
+ "@Thus, it may have significant compensatory effects on chronic stress}Double Depression is seen in approximately #-#% of patients with MDD{20-25%}Monozygotic twins have been shown to have a #-#x increase in concordance rates for mood disorders over dizygotic twins{2-4x}A @hypomanic episode@ lasts at least 4 days and is similar to a manic episode except that it is @not sufficiently severe enough to cause impairment in@:{Social or occupational functioning}The defense mechanism most commonly used in depression is:{Introjection}Nearly 2/3 of patients with depressive disorders exhibit marked shortening of:{REM latency}What is the term for mood elevation in response to something good happening?{Mood reactivity}What is the term for a heavy, leaden feelings in one's arms and legs?{Leaden paralysis}What is the amino acid precursor to serotonin?{Tryptophan}What is the amino acid precursor to dopamine?{Tyrosine}L-Tryptophan products were recalled in the U.S. because it was associated with:{Eosinophilia-myalgia syndrome}What is the term for depression that results from a specific life event?{Reactive depression}Reactive depression can be best compared to what disorder?{Adjustment disorder}Rapid cycling bipolar disorder is more common in Men or Women?{Women}Rapid cycling is defined as the occurance of #+ episodes of depression, hypomania, or mania per year{4+}The lifetime prevalence rate of cyclothymia is #-#%{0.4-1%}Which is more often present in depressed patients: psychomotor agitation or psychomotor retardation?{Psychomotor retardation}What is the term for the inability to describe or be aware of one's emotions or mood?{Alexithymia}The highest suicide rates are in what age group?{65+}Suicide is almost #x as frequent in older adults{2x}The suicide rate for Caucasian men age 65+ is #x higher than that of the general population.{5x}Aging @[increases/decreases]@ suicide attempts and @[increases/decreases]@ their lethality{Decreases; Increases}Schizoaffective Disorder AKA:{Cycloid psychosis}What are some medications that can precipitate mania?{- bromocriptine\n"
+ "- isoniazide\n"
+ "- cimetidine\n"
+ "- disulfiram}Usually #-# ECT treatments are required to achieve symptomatic remission.{8-12}What is a common cognitive side effect of ECT?{Retrograde amnesia}What are the typical laboratory findings in NMS?{Leukocytosis and severely elevated CPK}True or False:\n\n"
+ "Patients with anticholinergic delirium are more likely to be agitated than withdrawn.{True}Appropriate treatment (by the medical team) of NMS includes:{- Life support\n"
+ "- Maintaining fluid and electrolyte balance\n"
+ "- Decreasing fever}The treatment of NMS commonly combines what 2 medications?{bromocriptine & dantrolene}Which class of medication is particularly effective for the treatment of @atypical depression@?{MAOIs}What are 2 important side effects of MAOI therapy?{Hypertensive Crisis & Serotonin Syndrome}Hypertensive Crisis can be precipitated by eating foods rich in ________________.{Tyramine}Serotonin Syndrome is caused by the interaction of an MAOI with a ___________________.{SSRI, pseudoephedrine, or meperidine}True or False:\n\n"
+ "Active SI is common in bereavement.{False}In what country is the diagnosis of @neurasthenia@ currently used the most?{China}What is the ICD-10 diagnosis for the following: \"persistent and distressing complaints of increased fatigue after mental effort, or persistent and distressing complaints of bodily weakness and exhaustion after minimal effort\"{Neurasthenia}What is a name for the condition that is the result of exhaustion of the CNS's energy reserves?{Neurasthenia}Neurasthenia is AKA:{Americanitis{https://o.quizlet.com/o5OIrToAmGoI.s2T15HuBQ_m.jpg}\n";
final String subst = "<b>\\1</b>\\2";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(string);
// The substituted value will be contained in the result variable
final String result = matcher.replaceAll(subst);
System.out.println("Substitution result: " + result);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html