perl problem

Discussion in 'Programming' started by ssimon171078, Jul 29, 2014.

  1. #1
    i need to extract users from link example:
    website/users/wpbuzz/gigs/invite-all-my-facebook-friends-5000-to-join-your-groupfanpage-up-to-5-invites

    users that i need to receive is wpbuzz i want to use perl with regular expressions .
     
    ssimon171078, Jul 29, 2014 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,821
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #2
    How far through the script process are you?
    Which bit is giving you errors and what are the errors?
     
    sarahk, Jul 29, 2014 IP
  3. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #3
    Extract username from URL?

    
    #!/usr/bin/perl -w
    
    use strict;
    use warnings;
    
    my $url = qq{website/users/wpbuzz/gigs/invite-all-my-facebook-friends-5000-to-join-your-groupfanpage-up-to-5-invites};
    
    $url  =~ m#website/users/(.*)/gigs#i;
    my $user = $1;
    
    print $user;
    
    Code (markup):
     
    NetStar, Aug 2, 2014 IP