Regular Expression Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • @d@m
    New User
    • Oct 2014
    • 1

    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!
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    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

    Comment

    Working...