Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2017
    Posts
    1

    Default EDIFACT - Regex rules with variable possible?

    Hi everyone,

    I'm currently working for a POC including the Beyond Compare Version 4.
    I would like to prove that this tools is compatible with the EDIFACT standard, and that we will be able to use it for mass files and folder testing.

    I have setup a session for EDIFACT file comparaison, and I have created some Rules.
    The process is ok, and it's working fine.

    I can compare those two lines and ignore the differences without any issues:
    Ref: DTM+137:20171022:102'
    ToCompare: DTM+137:20171024:102'
    Regex: ^DTM\+137.*'

    However, I have more difficulties to find something for this one:
    Ref: UNZ+1+1058991'
    Case 1: UNZ+1+1058992'
    Case 2: UNZ+3+1058991'

    What I want:
    I would like to accept Case 1, because "1058992" is an ID generated for each messages.
    I would like to reject Case2, because "3" here isn't the same than "1".
    The problem for me is that "1" here, is a variable. If my reference is "3", the result of my compare should reject Case1 and accept Case2.

    Any idea how can I reproduce this ?

    Thank you and regards,

    Kevin

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

    Default

    It isn't possible to match on a string while marking only a subset of that string unimportant. If you define a grammar element or unimportant text, the entire matching string is always affected.

    As a workaround, you can try matching on just the decimals.

    Regex: +\d{7}
    Chris K Scooter Software

Tags for this Thread

Posting Permissions

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