Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

REGEXTRACT expression to extract text between brackets

Posted on 2016-08-27
8
Medium Priority
?
182 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 33

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 33

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
Independent Software Vendors: 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!

 
LVL 35

Accepted Solution

by:
Dan Craciun earned 2000 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 33

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 33

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Whether you’re looking to gather data for research or gather feedback on an idea, being able to build and distribute your own online survey is not only cost-effective, but allows you to reach a larger audience and receive results in real-time. Googl…
Working with spreadsheets can be a daunting task, especially when having to deal with large amounts of data. All you see are rows and rows of numbers and soon your eyes begin to glaze over. Take advantage of the tools in Google Sheets to create prof…
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 in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

879 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