Question: I need a **regular expression to match the paragraph name while reading a COBOL file** in java. following are the example for paragraph name..

```
9800-WRITE-SCREEN-A.
C70-WRITE-ABFGRPPARM.
FGH0-REWRITE-ABFGRPPARM. 
8100-FILE-ERROR.

```

thanks

Answer: 
```
"^[ ]{7,10}([-\\w]+)"

```

Paragraph names begin in columns 8-11. $1 will be the name.
Some rules:

1. Paragraph names begin in Area A (columns 8-11).
2. Can contain characters, numbers or hyphens.
3. Ends with a dot(.).
4. No whitespace character.

Regex = ^[ ]{7,10}([-\w]+\.\n)