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

Question

Question

Regexpress pattern to get the next line values

asked on September 19, 2017

Hi, I would like to extract the Salesman # from the OCRed Text. Sometimes the ocred  Salesman # and name in the sameline (EX1)  whereas some time OCRed the data is splited into another lines (Ex2).

Ex1.

Salesman : 107 - Rajeev  

Ex2.

Salesman:

107

- Rajeev

 

I have created the pattern as Salesman.*?(\d{3}) its work fine in Ex1 whereas in Ex2 it return fail. I need a pattern to extract the Salesman no 107 in both scenario.

Thanks

Ganesh

0 0

Answer

SELECTED ANSWER
replied on September 19, 2017

Hi Ganesa,

Hope this helps - I'm not sure if there are multiple line breaks in your example however the below RegEx should account for both situations.

Salesman[\s:\n]{1,}(\d{3})[\s-\n]{1,}

3 0

Replies

replied on September 19, 2017

Hi Ronald,

 

Thanks its works perfect. Great!

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

Sign in to reply to this post.