Solved

REGEXTRACT expression to extract text between brackets

Posted on 2016-08-27
8
78 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 30

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 30

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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 34

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 30

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 30

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Google is more than just a search engine. Over the years the company has developed a wide range of online services that are readily available to all users. This article highlights how one can use Google services for simple project management.
This Micro Tutorial will demonstrate importing calendar invites from events such as webinars into your Google Calendar.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

830 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