Solved

REGEXTRACT expression to extract text between brackets

Posted on 2016-08-27
8
55 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
If your app took Google’s lash recently, here are the 5 most likely reasons.
This Micro Tutorial will demonstrate how to use comments in Google Docs. You will learn how to create, edit, and delete a comment.
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

758 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

22 Experts available now in Live!

Get 1:1 Help Now