Solved

REGEXTRACT expression to extract text between brackets

Posted on 2016-08-27
8
113 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
[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
  • 2
  • 2
8 Comments
 
LVL 31

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 31

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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 35

Accepted Solution

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

Open in new window


HTH,
Dan
0
 

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 31

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 35

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 31

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Learn new improvements released by Google for Google Calendar. Noted in this article are simple tips and tricks that can make your everyday use of Google Calendar better.
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
This Micro Tutorial  demonstrates whether your site uses one subdomain or multiple subdomains, how to create full URLs from Google Analytics content reports. This procedure is called concatenation and can also be done with the CONCATENTATE function.…
This Micro Tutorial will introduce a Google tool, which is a great way to learn more about dimensions in metrics in Google Analytics, even if you use the interface or the API.

628 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