REGEXTRACT expression to extract text between brackets

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
xeniumAsked:
Who is Participating?
 
Dan CraciunConnect With a Mentor IT ConsultantCommented:
=REGEXEXTRACT(B3,"\((.*?)\)")

Open in new window


HTH,
Dan
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You may also use....
In E2
=MID(B2,FIND("(",B2)+1,FIND(")",B2)-FIND("(",B2)-1)

Open in new window

and copy down.
0
 
xeniumAuthor Commented:
Thanks yes i coudl do that but i want REGEX for neatness, and it's going into an array formula
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Okay try this...

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

Open in new window

0
 
xeniumAuthor Commented:
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
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
No problem.
Array formula was one you used on the sheet. I just modified the regex pattern. :)
0
 
Dan CraciunIT ConsultantCommented:
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
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
@Dan

It's okay. I am happy that the issue got resolved for him.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.