Regex matching a #

Discussion in 'Perl' started by Gharial, Sep 8, 2004.

  1. Gharial

    Gharial Guest

    This sounds like a very simple problem but I cannot get a match for a
    line beginning with a "#" (a comment line). I tried backslashing the
    "#", also tried putting in the hex and octal values in the m// but no
    success. Perhaps someone out there can help.
     
    Gharial, Sep 8, 2004
    #1
    1. Advertising

  2. Gharial wrote:
    > This sounds like a very simple problem but I cannot get a match for
    > a line beginning with a "#" (a comment line). I tried backslashing
    > the "#", also tried putting in the hex and octal values in the m//
    > but no success. Perhaps someone out there can help.


    I don't see your code.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Sep 8, 2004
    #2
    1. Advertising

  3. Gharial

    Joe Smith Guest

    Gharial wrote:

    > This sounds like a very simple problem but I cannot get a match for a
    > line beginning with a "#" (a comment line). I tried backslashing the
    > "#", also tried putting in the hex and octal values in the m// but no
    > success. Perhaps someone out there can help.


    It's trivial to match a poundsign at the beginning of the line.
    Show us what you've tried so far.
    Post your response to comp.lang.perl.misc, not here (comp.lang.perl).
    -Joe
     
    Joe Smith, Sep 8, 2004
    #3
  4. Gharial

    Guest

    (Gharial) wrote in message news:<>...
    > This sounds like a very simple problem but I cannot get a match for a
    > line beginning with a "#" (a comment line). I tried backslashing the
    > "#", also tried putting in the hex and octal values in the m// but no
    > success.


    There should be no problem.

    > Perhaps someone out there can help.


    Not without seeing your real problem.

    Please post a _mimimal_ but _complete_ program that illustrates the
    problem you are having.

    Note the above advice can be found in the posting guidelines that are
    frequently posted to the newsgroup that superceded this one when this
    one ceased to exist many years ago (see FAQ).

    You may want to write to Google to ask them to put a warning when you
    post to a non-existant group. I've already done so. If enough people
    do so then they may actually think there's a real need.
     
    , Sep 8, 2004
    #4
    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. Xah Lee
    Replies:
    1
    Views:
    943
    Ilias Lazaridis
    Sep 22, 2006
  2. Xah Lee
    Replies:
    8
    Views:
    462
    Ilias Lazaridis
    Sep 26, 2006
  3. Replies:
    3
    Views:
    768
    Reedick, Andrew
    Jul 1, 2008
  4. Xah Lee
    Replies:
    2
    Views:
    218
    Xah Lee
    Sep 25, 2006
  5. Replies:
    2
    Views:
    395
Loading...

Share This Page