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

Question

Question

Quickfields Regular Expression to Remove Text After the Date

asked on May 11, 2016

I'm trying to strip out the issue date only the Zone OCR produces:

PERMIT ISSUED TO ISSUANCE
A TEXAN WINDOW CO ISSUE DATE: 5/9/2016
P.O. BOX 691 EXPIRATION DATE: 11/4/2016

I'm using the following regular expression:   (?:ISSUE DATE:)([^\a]*) but I need all text after the ISSUE DATE: 5/9/2016 to be removed.  The text after 5/9/2016 will vary.  Any suggestions?

Thanks!

0 0

Replies

replied on May 11, 2016

Will the issue date always be the end of a line? If so, this works for me:

(?:ISSUE DATE: )([^\a]*)\n

1 0
replied on May 11, 2016

Most times it is all on one line like this:

ISSUE DATE:  5/9/2016  P.O. BOX 691 EXPIRATION DATE:  8/9/2018

0 0
replied on May 11, 2016

You could change the range to specify numbers and slashes only. [^\a] is fairly inclusive.

0 0
replied on May 11, 2016

You can use ([0-9\/]*) instead of ([^\a]*).

 

 

0 0
replied on May 12, 2016

I tried using (?:ISSUE DATE:)([^\a]*)[^\a] and (?:ISSUE DATE:)([^\a]*)([0-9V]*) got the following result:

  5/9/2016  P.O. BOX 691 EXPIRATION DATE:  8/9/201

The expression did not strip out P.O. Box 691 EXPIRATION DATE:  8/9/2018

Any other thoughts?

0 0
replied on May 12, 2016

I'm not really sure what you're trying to do with [^\a]*. That would be everything but a "bell" character. Since regular expression is greedy, that matches everything.

Should be just (?:ISSUE DATE:)\s*([0-9\/]+)

0 0
replied on May 12, 2016

Tried (?:ISSUE DATE:)\s*([0-9V]+) and it gave the following results:

5

Getting closer.  Any more thoughts?

0 0
replied on May 12, 2016

You seem to have a "V" not a backslash ("\") followed by a forward slash ("/") in that one. I'm not sure if that happens from copying from this page (I got the same behavior copying your regex above) or if it was a typo to begin with.

1 0
replied on May 12, 2016

It worked!  Thank you so much.  You're the best.

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

Sign in to reply to this post.