Chapter 16 – Frogs in a Well

Processing the rest of the string functions took a long time, but it was mostly trouble free. The real trouble was Inoue’s dangerous driving. Anyway, I was able to finish the quest without any problems, even without Saito’s presence, which gave me a boost in confidence as a worker.

Back at the office, Inouye began to explain the functions I hadn’t heard of before as she drank a highball.

“Well, I guess I’ll start with the REGEX functions since it’s hard to explain SPLIT.”

“Is there more than one REGEX function?”

“REGEX stands for regular expression. Do you understand what regular expressions are, Takahashi-san?”

“Yes, a coworker, an engineer, taught me a little about them before, and I have used them to process CSV files before pasting them into Excel.”

“What, you know about regular expressions? Oh, excuse me, I’ll have another highball.”

Inouye, looked a little annoyed as she downed about 1/3 of her highball in one gulp.

“The REGEX functions are string functions that use regular expressions. There are three REGEX functions: REGEXMATCH for searching, REGEXEXTRACT for extracting, and REGEXREPLACE for replacing.”

Inoue wrote the syntax for each function on a paper napkin.

=REGEXEXTRACT(Text, Regular Expression)

=REGEXMATCH(Text, Regular Expression)

=REGEXREPLACE(Text, Regular Expression, Replacement)

“Someone who only knows Excel would often write a function that uses FIND, LEFT, and multiple IFs to extract the prefecture, but if you use the REGEX function, you can do it in one-shot like this.”

=REGEXEXTRACT(address, “.{2,3}[prefecture]”)

“It’s a basic example, but it’s obvious at a glance what the expression is intended to do, isn’t it? With just this one line, Tokyo can be extracted from ‘Tokyo Minato Ward Roppongi 6-Chome 10-1 Roppongi Hills Mori Tower’, and ‘Kagoshima Prefecture’ can be extracted from “Kagoshima Prefecture Shibushi City Shibushi Municipality Shibushi 2-Chome 1-1 Shibushi City Hall Shibushi Branch'”

I was overwhelmed by the power of the REGEX function. Compared to the REGEX function, ordinary string functions were complete garbage. There was no need to argue which one was better. As for the processing speed, I couldn’t make a practical comparison, but it was probably faster because it was simpler. Even if it were slower, it would make up for if it in the difference in readability. Readability is not just about how easy it is to understand, but also about its applicability in other processes. The core reason for writing complex processes in as simple a format as possible was primarily to improve their applicability.

I completely underestimated Inouye. The highball she ordered earlier was almost gone as she ordered another one. Her pace was fast. She explained everything to me in a flowing manner. Saito and Inoue were the only workers I have worked with since I came to this world. Saito was always calm, experienced, and dependable, but I honestly underestimated Inoue, who had always been gotten the better of by VLOOKUP, and was also stubborn and inflexible in her ways. However, Inoue had the ability to be reincarnated as a worker. There was a lot I still didn’t know. I was still a novice as a worker, or maybe even as an Excel expert to begin with. I could make spreadsheets that no one else could make. But that had only been in a company of about 20 people. The world was a big place, and I hadn’t even tried the newest trend, Google Spreadsheets. I was stupid. Too stupid.

While I was silent, Inoue asked for more highballs.

 

※Functions used

REGEXEXTRACT https://support.google.com/docs/answer/3098244

REGEXMATCH https://support.google.com/docs/answer/3098292

REGEXREPLACE https://support.google.com/docs/answer/3098245

[Previous Chapter] [Table of Contents] [Next Chapter]

Leave a Reply

Your email address will not be published. Required fields are marked *