LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-06-2002, 05:06 AM   #1
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
perl: substring extraction after specific char


How to get /usr/lib/libdns.so.5 out of

Code:
	libdns.so.5 => /usr/lib/libdns.so.5 (0x40026000)
 
Old 10-06-2002, 05:34 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Code:
$string=~/.+=>\s(.+)\s\(.+/;
print $1;
should do the trick, although you've not said how flexible the string is. i.e. which bits will always be there to compare against. read the regex page for more information "perldoc perlre". read through there and try to write out the regex i've written in a more long hand form.

Can i side track you for a minute and ask why you've said "How to get..." rather than "How can i get..." or "How do i get..." etc...? 9/10 non-english people seem to say that when asking a question. Does it make more sense to say what you have in a literal translation to german or other languages? thanks.
 
Old 10-06-2002, 05:48 AM   #3
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Original Poster
Rep: Reputation: 46
First of all thanks for your reply. Really have to check up on perl regular expressions

As for the side question, depends on the time, mood, etc somehow in which way at least I ask questions. Can't give you a real answer on that - sorry
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read a char from a file (PERL) linuxlover1 Programming 4 01-09-2005 09:10 AM
C pointers confusion - char ** = char [][] ?? saravkrish Programming 12 12-02-2004 10:06 AM
C Problem---convert char to char* totti10 Programming 11 11-06-2004 11:32 AM
invalid conversion from `char' to `const char* bru Programming 6 05-09-2004 03:07 PM
Perl : Changing a single char in a string richhill Programming 2 09-17-2003 04:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration