?
Solved

URGENT: Strip a header down

Posted on 2003-12-10
7
Medium Priority
?
227 Views
Last Modified: 2006-11-17
HI All;

I have the following string:

"MyODBC List" <myodbc@lists.mysql.com>

I want to lose everything but what is inside the <>, so I need a function/regexp that takes the string above and returns:

myodbc@lists.mysql.com

Lots of points because I want to deal with this quickly.
0
Comment
Question by:Squeebee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9918147
$text = 'MyODBC List" <myodbc@lists.mysql.com>';
preg_match_all("|<(.*)>|U",$text,$res);

print_r($res[0]);
0
 
LVL 24

Accepted Solution

by:
shivsa earned 2000 total points
ID: 9918171
there is a syntex error in this.

$text = 'MyODBC List <myodbc@lists.mysql.com>';

preg_match_all("|<(.*)>|U",$text,$res);

print_r($res[0]);

0
 
LVL 17

Author Comment

by:Squeebee
ID: 9918197
Man, thank for fast response. Any way to avoid the hassle of dealing with a return in an array?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 17

Author Comment

by:Squeebee
ID: 9918204
Oh, and the output is still wrapped in < >, I need it without any < >
0
 
LVL 17

Author Comment

by:Squeebee
ID: 9918238
Nevermind, I managed to tweak it with a str_replace!

Thanks for your help!
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9918239
could u check what
print_r($res[1]); will return i think this should return without <>.


0
 
LVL 17

Author Comment

by:Squeebee
ID: 9918246
Excellent, it does indeed.
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question