FAQ
Hi

I have a line as shown below:

//abc/... (<sometext>)

Now i want to substitute (<sometext>) with blank space. How do i do it.

I tried s/\(\Q<sometext>\)//g. This isnt working.

Next i have a line as below

//abc#4.

Now i want an output //abc. So how do i remove the numeric value and the preceding #?

Regards
Sudhindra

Search Discussions

  • JupiterHost.Net at Jun 9, 2004 at 1:37 pm

    sudhindra k s wrote:


    Hi

    I have a line as shown below:

    //abc/... (<sometext>)

    Now i want to substitute (<sometext>) with blank space. How do i do it.
    my $string = '//abc/... (<sometext>)';
    $string =~ s/\(\<sometext\>\)//;
    print $string;
    I tried s/\(\Q<sometext>\)//g. This isnt working.

    Next i have a line as below

    //abc#4.

    Now i want an output //abc. So how do i remove the numeric value and the preceding #?
    my $string = '//abc#4';
    $string =~ s/\#\d$//;
    print $string;


    perldoc perlre
    is nice.

    I also use perl via CLI (perl -e 'test code here') to work out things
    like this at times.

    HTH :)

    Lee.M - JupiterHost.Net

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedJun 9, '04 at 10:45a
activeJun 9, '04 at 1:37p
posts2
users2
websiteperl.org

2 users in discussion

Sudhindra k s: 1 post JupiterHost.Net: 1 post

People

Translate

site design / logo © 2021 Grokbase