No announcement yet.

EDIFACT - Regex rules with variable possible?

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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,


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