You are viewing limited content. For full access, please sign in.

Question

Question

Zone OCR with line breaks

asked on June 10, 2015 Show version history

I'm trying to capture several lines of text that always comes after a key phrase. For example:

ORDINANCE NO. 07-602
AN ORDINANCE OF THE CITY COUNCIL OF THE CITY
OF SHAFTER ADOPTING AN AMENDMENT TO THE
COMMUNITY DEVELOPMENT PLAN FOR THE
PROJECT NO. 2 COMMUNITY DEVELOPMENT
PROJECT AREA, ADOPTING AN EMINENT DOMAIN
 

I want to catch everything after Ordinance No. 07-602.

I'm have tried several regexpressions and the line breaks keep causing a problem. This one has gotten me the closest to what I want: Ordinance No.\s*\d*\S*\d\d\d\d*(\D+)

However, as soon as it hits another digit character, in this case 2 on line 4, it cuts off. Also the part of the value that is returned eliminates space characters where there was a new line. I would like there to be a space between lines. Any ideas how to make this work? 

 

0 0

Replies

replied on June 10, 2015

Ordinance No.\s*\d*\S*\d\d\d\d*\n\n(.+)  should do it. \n is a newline character, Zone OCR uses 2 at the end of every line. Pattern Matching does not strip out the newline characters from the results (unless you set it to "all results with no spaces"), but whether you see them or not would depend on what you do with the data afterwards.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.