Stupid RE question

Discussion in 'Perl' started by Michael W Cocke, Dec 27, 2004.

  1. I'm sure this is obvious, but I'm missing it - What's the regular
    expression to extract everything from the start of the line to the
    first hyphen?

    Thanks!

    Mike-

    --
    If you can keep your head while those around you are losing theirs...
    You may have a great career as a network administrator ahead!
    --
    Please note - Due to the intense volume of spam, we have installed
    site-wide spam filters at catherders.com. If email from you bounces,
    try non-HTML, non-encoded, non-attachments,
     
    Michael W Cocke, Dec 27, 2004
    #1
    1. Advertising

  2. Michael W Cocke

    Jim Gibson Guest

    In article <>, Michael W
    Cocke <> wrote:

    > I'm sure this is obvious, but I'm missing it - What's the regular
    > expression to extract everything from the start of the line to the
    > first hyphen?


    if( $string =~ m/^([^-]*)-/ ) {
    print "match: $1\n";
    }

    FYI: this newsgroup is defunct; try comp.lang.perl.misc in the future.


    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
     
    Jim Gibson, Dec 27, 2004
    #2
    1. Advertising

  3. On Mon, 27 Dec 2004 11:21:12 -0800, Jim Gibson
    <> wrote:

    >
    >FYI: this newsgroup is defunct; try comp.lang.perl.misc in the future.


    Done, thanks.

    Mike-

    --
    If you can keep your head while those around you are losing theirs...
    You may have a great career as a network administrator ahead!
    --
    Please note - Due to the intense volume of spam, we have installed
    site-wide spam filters at catherders.com. If email from you bounces,
    try non-HTML, non-encoded, non-attachments,
     
    Michael W Cocke, Dec 28, 2004
    #3
    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. Steve

    Is this a stupid question?

    Steve, Jul 17, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    357
    Mario Vargas
    Jul 17, 2003
  2. Will

    Stupid C# question Please help!

    Will, Aug 8, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    453
    carlos medina
    Aug 9, 2003
  3. Joerg Jooss

    Re: Stupid HTTP Request Question

    Joerg Jooss, May 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    410
    Joerg Jooss
    May 15, 2004
  4. Brandon McCombs
    Replies:
    4
    Views:
    525
    Richard Wheeldon
    Aug 28, 2006
  5. rincewind

    stupid, STUPID question!

    rincewind, Apr 19, 2009, in forum: HTML
    Replies:
    25
    Views:
    1,039
Loading...

Share This Page