$re = '/{ ([a-zA-Z\-]+(\(\d+\))?(\d+)?,(..)? )+ (.*) }/';
$str = '($RCSfile: noun.event,v $ $Revision: 9.0 $ $Date: 2011/02/06 21:16:44 $ $Name: $ $State: Rel $)
(Copyright (c) 1988-2011 by Princeton University)
(noun.event)
{ might-have-been, noun.Tops:event,@ (an event that could have occurred but never did) }
{ nonevent, noun.Tops:event,@ (an anticipated event that turns out to be far less significant than was expected) }
{ [ happening, verb.change:happen,+ ] [ occurrence, adj.all:current^occurrent,+ ] occurrent, natural_event, noun.Tops:event,@ (an event that happens) }
{ [ accompaniment, verb.stative:accompany,+ ] concomitant, [ attendant, adj.all:subsequent^attendant,+ ] [ co-occurrence, adj.all:synchronous^co-occurrent,+ verb.stative:cooccur,+ ] happening,@ (an event or situation that happens at the same time as or in connection with another) }
{ associate, accompaniment,@ (any event that usually accompanies or is closely connected with another; "first was the lightning and then its thunderous associate") }
{ avalanche1, happening,@ (a sudden appearance of an overwhelming number of things; "the program brought an avalanche of mail") }
{ [ background1, verb.change:background,+ ] accompaniment,@ (relatively unimportant or inconspicuous accompanying situation; "when the rain came he could hear the sound of thunder in the background") }
{ [ experience, verb.change:experience,+ verb.emotion:experience,+ verb.perception:experience,+ verb.perception:experience1,+ ] happening,@ (an event as apprehended; "a surprising experience"; "that painful experience certainly got our attention") }
{ appalling, experience,@ (an experience that appalls; "is it better to view the appalling or merely hear of it?") }
{ [ augury, verb.change:inaugurate,+ ] sign, foretoken, preindication, experience,@ (an event that is experienced as indicating important things to come; "he hoped it was an augury"; "it was a sign from God") }
{ war_cloud, augury,@ (an ominous sign that war threatens) }
{ [ omen, adj.all:unpropitious^ominous,+ adj.all:alarming^ominous,+ verb.communication:omen,+ ] [ portent, adj.all:significant^portentous,+ adj.all:prophetic^portentous,+ verb.communication:portend,+ ] [ presage, verb.communication:presage,+ ] [ prognostic, adj.all:prophetic^prognostic,+ ] [ prognostication, verb.communication:prognosticate1,+ ] [ prodigy, adj.all:significant^prodigious,+ ] augury,@ (a sign of something about to happen; "he looked for an omen before going into battle") }
{ [ auspice, verb.communication:auspicate,+ verb.change:auspicate,+ ] omen,@ (a favorable omen) }
{ [ foreboding, verb.communication:forebode,+ ] omen,@ (an unfavorable omen) }
{ death_knell, omen,@ (an omen of death or destruction) }
{ [ flash1, verb.change:flash3,+ ] [ flashing, verb.change:flash3,+ ] experience,@ (a short vivid experience; "a flash of emotion swept over him"; "the flashings of pain were a warning") }
{ good_time, blast2, experience,@ (a highly pleasurable or exciting experience; "we had a good time at the party"; "celebrating after the game was a blast") }
{ loss1, experience,@ (the experience of losing a loved one; "he sympathized on the loss of their grandfather") }
{ near-death_experience, experience,@ (the experience of being close to death but surviving) }
{ ordeal, experience,@ (a severe or trying experience) }
{ out-of-body_experience, experience,@ (the dissociative experience of observing yourself from an external perspective as though your mind or soul had left and was observing your body) }
{ [ taste, verb.cognition:taste5,+ ] experience,@ (a brief experience of something; "he got a taste of life on the wild side"; "she enjoyed her brief taste of independence") }
{ time1, experience,@ (a person\'s experience on a particular occasion; "he had a time holding back the tears"; "they had a good time together") }
{ trip1, head_trip, experience,@ (an exciting or stimulating experience) }
{ vision, experience,@ (a religious or mystical experience of a supernatural appearance; "he had a vision of the Virgin Mary") }
{ social_event, noun.Tops:event,@ (an event characteristic of persons forming groups) }
{ [ miracle1, adj.all:fortunate^miraculous,+ ] noun.Tops:event,@ (a marvellous event manifesting a supernatural act of a divine agent) }
{ [ trouble, adj.all:troubled^troublous,+ verb.body:trouble,+ verb.emotion:trouble,+ verb.emotion:trouble1,+ ] happening,@ (an event causing distress or pain; "what is the trouble?"; "heart trouble") }
{ [ treat, verb.possession:treat,+ ] happening,@ (an occurrence that causes special pleasure or delight) }
{ [ miracle, adj.all:supernatural^miraculous,+ ] happening,@ (any amazing or wonderful occurrence) }
{ [ wonder, adj.all:extraordinary^wondrous,+ verb.communication:wonder12,+ ] [ marvel, adj.all:supernatural^marvelous,+ adj.all:supernatural^marvellous,+ verb.communication:marvel,+ verb.communication:marvel12,+ ] happening,@ (something that causes feelings of wonder; "the wonders of modern science") }
{ thing, happening,@ (an event; "a funny thing happened on the way to the...") }
{ episode, happening,@ (a happening that is distinctive in a series of related events) }
{ [ feast, verb.consumption:feast2,+ ] thing,@ (something experienced with great delight; "a feast for the eyes") }
{ [ drama, adj.all:impressive^dramatic,+ adj.all:dramatic,+ verb.communication:dramatize,+ verb.communication:dramatize1,+ verb.communication:dramatise1,+ ] dramatic_event, episode,@ (an episode that is turbulent or highly emotional) }
{ night_terror, drama,@ (an emotional episode (usually in young children) in which the person awakens in terror with feelings of anxiety and fear but is unable to remember any incident that might have provoked those feelings) }
{ eventuality, [ contingency, adj.all:possible^contingent,+ ] contingence, happening,@ (a possible event or occurrence or result) }
{ [ beginning, verb.change:begin1,+ ending,! ] happening,@ (the event consisting of the start of something; "the beginning of the war") }
{ casus_belli, beginning,@ (an event used to justify starting a war) }
{ [ ending, verb.stative:end1,+ verb.creation:end13,+ beginning,! ] conclusion, [ finish2, verb.change:finish3,+ verb.stative:finish,+ verb.change:finish2,+ ] happening,@ (event whose occurrence ends something; "his death marked the ending of an era"; "when these final episodes are broadcast it will be the finish of the show") }
{ [ end, verb.creation:end13,+ verb.stative:end1,+ verb.change:end1,+ verb.stative:end,+ ] last, ending,@ (the final stage or concluding parts of an event or occurrence; "the end was exciting"; "I had to miss the last of the movie") }
{ endgame, end_game, end,@ (the final stages of a chess game after most of the pieces have been removed from the board) }
{ endgame1, end_game1, end,@ (the final stages of an extended process of negotiation; "the diplomatic endgame") }
{ homestretch, end,@ noun.communication:colloquialism,;u (the end of an enterprise; "they were on the homestretch when the computer crashed") }
{ [ passing2, verb.change:pass1,+ ] end,@ (the end of something; "the passing of winter") }
{ [ result, verb.stative:result,+ ] [ resultant, adj.all:subsequent^resultant,+ verb.stative:result2,+ ] final_result, outcome, termination, ending,@ (something that results; "he listened for the results on the radio") }
{ denouement, result,@ (the outcome of a complex sequence of events) }
{ [ deal, verb.social:deal2,+ ] result,@ (the type of treatment received (especially as the result of an agreement); "he got a good deal on his car") }
{ fair_deal, square_deal, deal,@ (fair treatment) }
{ raw_deal, deal,@ (unfair treatment) }
{ decision1, result,@ (the outcome of a game or contest; "the team dropped three decisions in a row") }
{ decision2, result,@ noun.act:boxing,;c ((boxing) a victory won on points when no knockout has occurred; "had little trouble in taking a unanimous decision over his opponent") }
{ split_decision, decision2,@ (a boxing decision in which the judges are not unanimous) }
{ consequence, aftermath, result,@ (the outcome of an event especially as relative to an individual) }
{ corollary, consequence,@ (a practical consequence that follows naturally; "blind jealousy is a frequent corollary of passionate love") }
{ [ just_deserts, noun.communication:plural,;u ] comeuppance, comeupance, poetic_jstice, consequence,@ (an outcome (good or bad) that is well deserved and fitting) }
{ fruit, consequence,@ (the consequence of some effort or action; "he lived long enough to see the fruit of his policies") }
{ sequella, consequence,@ (a secondary consequence) }
{ train, consequence,@ (a series of consequences wrought by an event; "it led to a train of disasters") }
{ offspring, [ materialization1, verb.change:materialize,+ ] [ materialisation1, verb.change:materialise,+ ] noun.phenomenon:consequence,@ (something that comes into existence as a result; "industrialism prepared the way for acceptance of the French Revolution\'s various socialistic offspring"; "this skyscraper is the solid materialization of his efforts") }
{ separation1, result,@ (the termination of employment (by resignation or dismissal)) }
{ sequel, [ subsequence, adj.all:subsequent,+ ] result,@ (something that follows something else) }
{ wages, [ reward, verb.social:reward1,+ verb.possession:reward,+ ] payoff, consequence,@ (a recompense for worthy acts or retribution for wrongdoing; "the wages of sin is death"; "virtue is its own reward") }';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
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 PHP, please visit: http://php.net/manual/en/ref.pcre.php