I have text file which has text with newline char like this. I read that text file into a String
random Text
State v. USA
some more text
USA v.
NY
Some more text
USA
v.LA , MN v. ND
USA vs. MN
I want to know offset (i.e. starting and ending char index) of patterns like [Some word starting with cap] v. [Some word starting with cap]
Or [Some word starting with cap] vs. [Some word starting with cap]
For above example "State v. USA" => Start=11 and End=22
"USA v. NY" => Start=36 and End=45
I started with something like this http://rubular.com/r/T7Ii2WDADw which is not covering all cases .
So, the program could return a Map where key is Start+","+End and value is actual text like "State v. USA"