RegEx Help!

  • Thread starter Thread starter Chris Murphy via DotNetMonster.com
  • Start date Start date
C

Chris Murphy via DotNetMonster.com

Hey guys, my RegEx experience is terrible, and I'm in the middle of a
project where I need to convert a plain text dictionary. I have the words,
word type, definitions etc, in the following format:

Abalone (n.) A univalve mollusk of the genus Haliotis. The shell is lined
with mother-of-pearl, and used for ornamental purposes; the sea-ear.
Several large species are found on the coast of California, clinging
closely to the rocks.

And the Only way i can think of breaking everything down into pieces is
with RegEx.

I need to:
1. Extract the word ie: "Abalone" (sometimes there are chars like "-"
before the word.
2. Extract the word type ie: "(n.)"
3. Extract the Definition ie: "A univalve mollusk of the genus Haliotis..."

I was essentially hoping to throw this in a loop and parse the whole
dictionary or in chunks... Can anyone gimme a helping hand? TIA!
 
how about locking for ^[-a-zA-z] \([vna]\) then you take the out the last 3
chr for the (n) or whatever, the leading will be your dictiionary term,

Since you get returned the length and postion of the matched string, you
should be able to mark the begining of the your dictinaory defn.


as for end of your defn it will be the begining before you next match
 
Back
Top