Use REGEXEXTRACT Function Between Two Characters in Google Sheets

While working on google sheets sometimes you need to extract some particular characters, Capital letters, decimal numbers, and so on. But Getting all this method done manually is very time-consuming and quite difficult. Here, we will learn how to use the REGEXEXTRACT function between two characters in google sheets using simple and practical examples. So, let’s start.


A Sample of Practice Spreadsheet

You may copy the spreadsheet below and practice by yourself.


Introduction to the REGEXEXTRACT Function in Google Sheets

The REGEXEXTRACT function returns the texts in a string. The REGEXEXTRACT function extracts individual texts from a string and shows the texts as output. For example, suppose the actual Text is “Here is a beautiful Bird” then the output will be H as the REGEXEXTRACT function extracts individual characters from a string.

Syntax

REGEXETRACT (text, regular_expression )

google sheets regexextract between two characters

Inputs

ARGUMENT REQUIREMENT Sample heading
text Required The input of the total text.
regular_expression Optional/ Required The characters of the expression will be returned.

Return Value

Returns the exact match from the actual text.


12 Practical Examples of Using REGEXEXTRACT Function Between Two Characters in Google Sheets

Here, follow the simple examples to learn about using the Google Sheets REGEXEXTRACT function between two characters.

1. Extracting Between Two Characters

Here, we will use the REGEXEXTRACT function to extract the actual character in the dataset between two random characters using the below dataset.

Dataset for extracting between two characters

Follow the steps below to execute this method.

📌 Steps:

  • First, Select cell C5 to enter the REGEXEXTRACT function.

selecting cell C5

  • Then, enter the function and select cell B5 for the actual test or manually write down the text and close it with double quotes.

entering REGEXEXTRACT function in gooogle sheets

  • After that, write down two characters manually using (|) to select either of the characters which is in the text and close this part with double quotes as below.
  • So, the overall formula is,
=REGEXEXTRACT(B5,"a|o")

Use of REGEXEXTRACT function between two charaxcters in google sheets

  • As the text contains “a” the output is “a”.
  • Now, drag down the fill handle and copy the formula into every blank cell of the dataset.

Drag down the formula


2. Pulling Out Single Characters

Now, we will use the REGEXEXTRACT function between two characters for pulling out single characters using the dataset below.

Dataset of pulling out single character

📌 Steps:

  • Initially, select cell C5 to enter the formula.
  • And, select cell B5 to get the text, or write down the total text manually and enclose it with double quotes as before.

entering REGEXEXTRACT function

  • Therefore, insert 5 dots to represent 5 characters in a word and close it with double quotes.
  • Find the formula below,
=REGEXEXTRACT(B5,".....")

use of REGEXEXTRACT function btween two characters in google sheets using pull out single character

  • Finally, drag down the fill handle and copy the same formula in the other cell.

Drag down the function


3. Bringing out Numbers

We will use the REGEXEXTRACT function between two characters to bring out numbers from the text using the below dataset. Let’s start.

Dataset of bringging out numbers

📌 Steps:

  • In the beginning, select cell C5 to enter the formula as before
  • Moreover, enter the formula and select cell B5 to get the text as below.

entering the function in google sheets

  • After that, write down “d” manually to get the decimal number along with \ to get the number as below.
  • Now, the formula,
=REGEXEXTRACT(B5,("\d"))

Bringing out numbers to use REGEXEXTRACT function between two characters in Google sheets

  • Now, drag down the fill handle as before to copy the formula in every cell.

Drag down the function

  • It is visible that the output will be shown as #N/A if there is no number in the text.
Note:
If we add a plus after d then it will show the total number from the dataset.

Read More: How to Find Unique Values Between 2 Columns in Google Sheets


4. Pulling out First Word

Step-by-step procedure of using the REGEXEXTRACT function between two characters to pull out the first word with the below dataset.

Dataset of pulling out first word

📌 Steps:

  • Now, select cell C5 to enter the function and then select cell B5 to get the whole test as a lookup value.

entering the REGEXEXTRACT function

  • Now write down (\w*) to get the first word as below.
  • Here, the formula is as follows
=REGEXEXTRACT(B5,"(\w*)")

Pulling out first word using REGEXEXTRACT function between two characters in Google sheets

  • Lastly, drag down the fill handle to copy the formula in the other cell.

Darg down the formula

Read More: How to Remove Spaces Between Words in Google Sheets


Similar Readings


5. Extracting Total Text

Here, We will extract the total text using the REGEXEXTRACT function between two characters with the below dataset.

Dataset o Extracting total Text

📌 Steps:

  • First, complete the steps already described to get the text.

enter the function

  • Now, write (.) and add a (+) sign with it so that the total text will be copied.
  • So, the overall formula is below,
=REGEXEXTRACT(B5,"(.+)")

Extracting total text using REGEXEXTRACT function between two characters in google sheets

  • Furthermore, drag down the fill handle to copy the formula.

Drag down filll handle

Read More: Generate Random Numbers or Text Between Limits in Google Sheets


6. Taking out the Middle Character

Follow the step-by-step procedure to use the REGEXEXTRACT function between two characters in case of taking out the middle character using the dataset below.

Dataset of taking out middle character

📌 Steps:

  • In the beginning, select the text as the way is already shown before.
  • Correspondingly, write down [A-Za-z] and put a blank space before. So, it covers everything except the first word.
  • As a result, the formula is,
=REGEXEXTRACT(B5,"\ [A-Za-z]")

taking out Middle character using REGEXEXTRACT function between two characters in google sheets

  • Lastly, drag the fill handle and execute the method.

Drag down fill handle


7. Finding and Matching Particular Word

The dataset below contains text and now we will extract a particular word using the REGEXEXTRACT function between two characters with the dataset below.

dataset of finding and matching particular word

  • Here, enter the formula into cell C5 and select B5 as the lookup value.
  • Now, to match the value with the text write the particular word and enclose the word with a double quote.
  • Finally, drag down the fill handle and complete the method as below.
  • Here, the output of the formula is as below
=REGEXEXTRACT(B5,"What")

finding and matching particular word using REGEXEXTRACT function between two characters in google sheets


8. Extracting both the Numbers and Preceding Characters

Here, we will extract both the number and preceding characters at the same time. The below dataset contains text with numbers and characters.

Dataset of extracting both numbers and characters

📌 Steps:

  • Clearly, at first, enter the formula into cell C5 and select cell B5 as the lookup value.
  • Therefore, write “(\w*)\s(\d+)” so that it returns both the number and character as below but this formula will return only the previous character of the number.
  • Overall formula,
=REGEXEXTRACT(B5, "(\w*)\s(\d+)")

Extracting both number and characters using REGEXEXTRACT function between two characters in Google sheet

  • Finally, drag down the fill handle and copy the formula.

drag down fill handle

Read More: Google Sheets Count Cells Between Two Numbers with COUNTIF Function


Similar Readings


9.  Finding Capital Letter

Now, we will execute the method of finding capital letters in the text using the REGEXEXTRACT function between two characters. The dataset is below.

Dataset of finding capital letter

  • After that select cell B5 as a lookup value into cell.
  • Moreover, write [A-Z] so that the formula returns to the first capital letter in the dataset, and then drag down the fill handle to complete the formula.
  • Now the formula is below
=REGEXEXTRACT(B5, "[A-Z]")

Finding capital letter using REGEXEXTRACT function between two characters in Google sheet


10. Pulling out Small Letter

Here, we will pull out small letters using the REGEXEXTRACT function with the same dataset.

Now follow the steps below to execute this method.

📌 Steps:

  • In the beginning, execute the formula as shown in the previous method.
  • But, we will use [a-z] instead of [A-Z] to get the return of the first small letter in the text.
  • So, the overall formula will be the following
=REGEXEXTRACT(B5, "[a-z]")

Pulling out small letter using REGEXEXTRACT function between two characters in Google sheet

  • As a result, we will get the first small letter from the selected text.
  • Following, drag the fill handle below to get a similar result for all texts.

11. Extracting Characters from Group

We will extract the existing character of the text from a group of random characters using the REGEXEXTRACT function. The dataset is below. Now, we want to extract characters from our determined group “Wjx” here. Follow the steps below to do this.

Dataset of extracting characters from group

📌 Steps:

  • Initially, enter the formula into cell C5 and use the lookup text as cell
  • Consequently, write down a random group of letters and enclose it with double quotes.
  • Complete the formula and drag down the fill handle to complete the method.
  • Here, the overall formula,
=REGEXEXTRACT(B5,"[Wjx]")

Extracrting characters from group using REGEXEXTRACT function between two characters in Google sheet


12. Taking out Decimal Numbers

Here, we will use the REGEXEXTRACT function to take out the decimal numbers from the text using the dataset below.

Dataset of taking out decimal numbers

📌 Steps:

  • In the beginning, select cell C5 and enter the formula.
  • Then, select cell B5 as the lookup text and write down [0-9] so that it returns to the decimal numbers only.
  • So, the formula is below,
=REGEXEXTRACT(B5, "[0-9]+")

Taking out decimal numbers using REGEXEXTRACT function between two characters in Google sheet

  • In the end, drag down the fill handle and complete the method.

Drag down the fill handle

Note:
Finding a number is already shown before but this method is easier than the other one and easy to extract.

Things to Remember

  • Always enclose text with double quotes while implementing the method.
  • Both numbers and letters can be extracted together using the REGEXEXTRACT function.

Conclusion

In this article, we explained how to use the REGEXEXTRACT function between two characters in Google Sheets in different ways. Hopefully, the methods will help you to apply the function to your own dataset. Please let us know in the comment section if you have any further queries or suggestions. You may also visit our OfficeWheel blog to explore more Google Sheets-related articles.


Related Articles

Afrina

Afrina

This is Afrina Nafisa. Currently working as a Technical Writer at OFFICEWHEEL.COM. I have done my graduation from Ahsanullah University of Science and Technology. As I am eager to learn more and more currently my motive is to make myself better every day with my work so that I can make better content for all the readers.

We will be happy to hear your thoughts

Leave a reply

OfficeWheel
Logo