Diff Files contaning regex pattern string

Discussion in 'Perl Misc' started by Michael Yang, May 13, 2007.

  1. Michael Yang

    Michael Yang Guest

    Here I have two files to diff, let's say one is a base file, the other
    is a result file.
    <base file>:
    Conntected to the '.*'
    Hello, I am .*
    Glad to see you .*
    <result file>:
    Connected to the 'www.perl.com'
    Hello, I am michael
    Nice to meet you, all

    There are regex pattern string ".*" in the base file, indicating that
    it could be replaced by any text.
    When the regex string of ".*" occurs, it should be detected that
    whether it matches the counter-part in the result file. If it matches,
    as shown above, the two lines are considered as equal.

    So when diff the above two files, only the last line of two files are
    in the diff data:
    Glad to see you .*
    and
    Nice to meet you, all

    If I want to do this, I need to implement my own diff algorithm.
    Is there any way simpler to achieve this? Like if there is a
    comparison function, designed by this regex algorithm, could be passed
    to Diff object, the diff program will compare two files based on the
    rules I gave to it.

    Your helps are greatly appreciated. :)
    Michael Yang, May 13, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cyril Vi?ville

    diff Process under diff users

    Cyril Vi?ville, Jun 29, 2004, in forum: Perl
    Replies:
    1
    Views:
    498
    Joe Smith
    Jun 29, 2004
  2. Berrucho
    Replies:
    2
    Views:
    617
    Infant Newbie
    Dec 5, 2003
  3. A Traveler

    Diff CSS styles for diff INPUT TYPE='s?

    A Traveler, Aug 31, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,903
    Steve Fulton
    Aug 31, 2004
  4. replace string contaning \n

    , Nov 13, 2007, in forum: Perl Misc
    Replies:
    5
    Views:
    90
    Tad McClellan
    Nov 14, 2007
  5. ChrisC
    Replies:
    4
    Views:
    158
    ChrisC
    Jun 25, 2010
Loading...

Share This Page