Hey all,
I have a parsing application where I am taking text files and choppiing them up (so to speak) There are small formatting differences which I was hoping to take care of with regular expression logic.
Here is example of one line:
$CHAP_01.txt$ 1 Chapter One
This line should be equivalent:
$CHAP_01.txt$ 1. Chapter One
(See the period after the one?)
I am using the split function with the regular expression " \\d+ " which works fine for the first one but for the second, I get an out of bounds exception when I refer to index 1 in the output array.
I was wondering if there was some way to use " \\d+ [ \\d+\\. ]" or some other logic in the regular expressions to split those two line s the same..
THanks
Karl
I have a parsing application where I am taking text files and choppiing them up (so to speak) There are small formatting differences which I was hoping to take care of with regular expression logic.
Here is example of one line:
$CHAP_01.txt$ 1 Chapter One
This line should be equivalent:
$CHAP_01.txt$ 1. Chapter One
(See the period after the one?)
I am using the split function with the regular expression " \\d+ " which works fine for the first one but for the second, I get an out of bounds exception when I refer to index 1 in the output array.
I was wondering if there was some way to use " \\d+ [ \\d+\\. ]" or some other logic in the regular expressions to split those two line s the same..
THanks
Karl
Comment