regex - issue in string processing.

Discussion in 'Perl' started by gk123987, Oct 24, 2008.

  1. gk123987

    gk123987 New Member

    Joined:
    Sep 9, 2008
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    i have a string,
    name=../temp/config.xml../temp/set.xml --cfg../runtime/perl --uniq_id=perl;

    Please not the above string is an eg, only

    i need a parsed o/p
    name = ../temp/config.xml ../temp/set.xml --cfg ../runtime/perl --uniq_id=perl;

    Here when i tried to use the command
    $line = s/..\// ..\//; (replace ../ with space ../) then i got the o/p as

    name = ../temp/config.x ../temp
    (note: .xml has been truncated to .x)
    your input would be of help
     
  2. gk123987

    gk123987 New Member

    Joined:
    Sep 9, 2008
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    sorry i found the root cause and it works.
    it should be
    $line = s/\.\.\// ..\//;
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice