Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2014
    Posts
    1

    Default Regular Expression Question

    I am trying to use a regular expression to define unimportant text in a compare and having some difficulty.

    Example:
    Left- ZIE|A02|20140924000136|||
    Right- ZIE|A02|20140924000137|||

    With the above example I would expect the line to show no differences. I would expect the below example to show differences though:

    Left- ZIE|A02|20140924000136|||
    Right- ZIE|A03|20140924000137|||

    I only want to ignore the difference in the specific date field. I don't want to ignore all date fields. I tried the below regex with a capturing group, but it marks the entire line as unimportant. Regex is not my forte, so hopefully I am missing something small.

    ^ZIE\|[\w|]{3}\|([0-9]+)\|.*

    Thanks in advance for the help!

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,610

    Default

    If you want to mark the 14 character timestamp unimportant anywhere, you can use the following regex:
    \|\d{14}\|

    It isn't possible to mark timestamps in lines starting with ZIE while still showing differences in the second column (A02, A03), etc.

    The other option is to use a regexp that matches on ZIE to the timestamp, which won't show A02 vs A03 as a difference:
    ^ZIE\|\w\d{2}\|\d{14}\|
    Chris K Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •