Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

perll, how to extract word in paren using regex

Posted on 2011-10-23
2
Medium Priority
?
230 Views
Last Modified: 2012-05-12
# I have data is this format, how to extract first name and last name
$fullName = "lastname(firstname)";
$fullName = "jones-smith(billy-bob)";

#How to regex to get $1 and $2 as last name and first name?
0
Comment
Question by:rgbcof
2 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 37016213
$fullName =~ /(.*)\((.*)\)/;
0
 

Author Closing Comment

by:rgbcof
ID: 37016374
You solved it.  Thanks.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

581 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