DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Split-Brain in Distributed Systems

Trending

  • The Bare Metal Bet That Made Our Multiplayer Platform Hum
  • Engineering Resilience Through Data: A Comprehensive Approach to Change Failure Rate Monitoring
  • Toward Indigenous AI: A Critical Analysis of BharatGen’s Role in Data Sovereignty and Language Equity
  • RAG vs. CAG: A Deep Dive into Context-Aware AI Generation Techniques

Regular Expressions: Valuable Knowledge or Waste of Brain Power?

How valuable is it to be a RegEx pro? This story explores what it took to try to explain the concept to a newbie and make on dev re-examine the value of RegEx.

By 
John Vester user avatar
John Vester
DZone Core CORE ·
Nov. 30, 17 · Opinion
Likes (20)
Comment
Save
Tweet
Share
91.9K Views

Join the DZone community and get the full member experience.

Join For Free

I was in a training class this week, covering some of the new features within the MuleSoft Anypoint Design Center.

The training class was being held over WebEx and was running in the PST time zone. Me being in the EST time zone, this made for a late start for the class (11 a.m.) and an even later ending for each day's sessions (after 7 p.m. local time).

Seven members of the CleanSlate Technology Group team, including myself, were attending the training. One individual (let's call him Dave), was very new to the MuleSoft space and had a background in technology that does not include a great deal of programming knowledge.

During the class, the instructor brought up the idea of using regex to enforce validation for a particular element to the API we were jointly creating. The instructor asked that we include the following line in our RAML-based API configuration:

pattern: ^[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}$

Initially confused, Dave asked, "What is all that text about?"

Regex Explained... on the Fly

What I found interesting was the dialog that ensued, where some of the other five team members (excluding myself) attempted to explain regular expressions to Dave... in a matter of a few words. Some of those who offered insight had 10+ years of programming experience, while another had just a year of programming experience under his belt. With each attempt, Dave seemed to get further confused and simply decided to accept not understanding the concept.

For the record, this is how Wikipedia defines a regular expression:

"A regular expression is, in theoretical computer science and formal language theory, a sequence of characters that define a search pattern. Usually this pattern is then used by string searching algorithms for "find" or "find and replace" operations on strings."

I added my insight, which is basically to say, "At one time, I really understood regex, but now I simply use Google to locate the right regular expression to meet my situation." I must confess that my response may have been related to working four hours before the 8-hour class started, allowing some slight fatigue to have an impact on my opinion.

Is Knowing Regex Really Worth Your Time ... and Brain Power?

Basically, I decided to let go of my regex knowledge in order to allow other more-valuable elements to remain in the prefrontal cortex of my brain. I realized years ago that Google and StackOverflow are amazing sources for finding the best regular expression for the need being solved. To me, this is no different than memorizing the aspects of an API when nearly every development tool provides the ability to use a dot (.) in order to provide a list of available methods or functions once the object is declared.

So, in my personal view, being a pro at regular expression creation is not a high priority.

What I am not sure of is if my views represent the majority or the minority of our current reader base. As I was driving home from the class, I decided I would create this article to state my views and hope others will provide their comments to compliment or contrast my views.

My core question is: Are you still taking up some of your valuable brain power to maintain regular expression creation ability?

Have a really great day!

Brain (computer virus)

Opinions expressed by DZone contributors are their own.

Related

  • Split-Brain in Distributed Systems

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: