Closed Thread
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Regex Expressions

  1. #11
    John_L is offline Newbie
    Join Date
    May 2008
    Posts
    10
    Rep Power
    0

    Re: Regex Expressions

    alright, cool thanks. I'm also having problems concatenating strings from standard input. My subroutine is called that contains a string in $_[0], which I want to concatenate with input from <stdin>. "." or "join()" doesn't seem to work. Can "\n" - new line characters cause problems when reading from standard input?

    Code:
    while( $line = <stdin> )
    {
       $_[0] = $_[0] . $line  #doesn't work
       $_[0] .= $line           #doesn't work
    }
    what's the best way to get this to work?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #12
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0

    Re: Regex Expressions

    yes, chomp() the input from stdin:

    while ( chomp(my $line = <STDIN>)) {
    $_[0] .= $line;
    }

  4. #13
    Nipa is offline Newbie
    Join Date
    Feb 2009
    Posts
    3
    Rep Power
    0

    Re: Regex Expressions

    I can't do that with the substitution expression can I? What if I have multiple CDATA tags to worry about? I'll try playing around

  5. #14
    KevinADC is offline Programmer
    Join Date
    Jan 2007
    Posts
    125
    Rep Power
    0

    Re: Regex Expressions

    Quote Originally Posted by Nipa View Post
    I can't do that with the substitution expression can I? What if I have multiple CDATA tags to worry about? I'll try playing around

    To me it looks like you are posting just to get your links posted on the forum. All you have done is posted pretty much useless replies to several very old threads. If thats not the case then I apologize. But if it is the case and you keep it up you'll just be banned from the forum and your posts removed and your links gone.

Closed Thread
Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Regex matching
    By ch3etah in forum Java Help
    Replies: 2
    Last Post: 06-01-2011, 06:34 AM
  2. Need some help with Regex
    By Edvinas in forum C# Programming
    Replies: 3
    Last Post: 06-25-2010, 12:12 PM
  3. Html Regex Help
    By amitUser in forum C# Programming
    Replies: 1
    Last Post: 01-27-2010, 12:11 AM
  4. RegEx in C++
    By BlaineSch in forum C and C++
    Replies: 2
    Last Post: 11-14-2009, 12:02 AM
  5. Tutorial: C# Regex
    By NeedHelp in forum C# Programming
    Replies: 0
    Last Post: 06-28-2006, 09:27 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts