Solved

REGEXTRACT expression to extract text between brackets

Posted on 2016-08-27
8
62 Views
Last Modified: 2016-08-27
Hi,

I'm looking to fix this formula so that it works as follows in google sheets:

Regex expression: \(.*?\)

Input: Jessica (M4KYYF)
Expected output: M4KYYF
Actual output: (M4KYYF)

Example online:
https://docs.google.com/spreadsheets/d/1BFjqRAhuptQTOSYhtlkYQ2P55wIvdAaaKLOSAEAsG3I/

Any ideas?

Thanks
0
Comment
Question by:xenium
  • 4
  • 2
  • 2
8 Comments
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41773075
You may also use....
In E2
=MID(B2,FIND("(",B2)+1,FIND(")",B2)-FIND("(",B2)-1)

Open in new window

and copy down.
0
 

Author Comment

by:xenium
ID: 41773089
Thanks yes i coudl do that but i want REGEX for neatness, and it's going into an array formula
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41773099
Okay try this...

In D2
=ARRAY_CONSTRAIN(ARRAYFORMULA(REGEXEXTRACT(B2,"\((.*?)\)")), 1, 1)

Open in new window

0
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 41773100
=REGEXEXTRACT(B3,"\((.*?)\)")

Open in new window


HTH,
Dan
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:xenium
ID: 41773122
Thanks Dan, that's perfect!

Subodh, thanks also, sorry i just noticed your answer is the same but i was distracted by the arrayformula
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41773124
No problem.
Array formula was one you used on the sheet. I just modified the regex pattern. :)
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 41773125
You're welcome and I was glad to help.

You can click on "Request attention" and ask a mod to re-open the question if you want to accept it differently.
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41773138
@Dan

It's okay. I am happy that the issue got resolved for him.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

You can provide a virtual interface for remote stakeholders in a SWOT analysis through a Google Drawing template. By making real time viewing and collaboration possible, your team can build a stronger product.
Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
This Micro Tutorial will demonstrate without sampling how to find out top organic landing pages. The hack gets around the standard way to find the pages in Google Analytics results in sampling for larger sites.
This Micro Tutorial demonstrates the importance of annotations in Google Analytics and how they should be used to document changes made to a site, Google updates (Ex: Panda & Penguin), marketing campaigns, and any other events that might have contri…

910 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now