REGEX Question

Hi All!

I have a quick REGEX question. I’ve been wracking my brain and have not had any luck and I’m certain it’s probably an easy fix, I’ve just been staring at it for way too long.

Using the Regex Split node, I have an OR list and I want the REGEX to split at the first occurrence of the combination of words within the OR and then just stop.

What seems to be happening is that it’s matching only a word from the OR list and continues to look. Is there a way around this?

For example:
This REGEX:

(.)(?=(QUALIFICATIONS Bachelor's|REQUIRED EDUCATION / EXPERIENCE|REQUIRED (MINIMUM) QUALIFICATIONS|QUALIFICATIONS)\b)(.)

will split at QUALIFICATIONS not at QUALIFICATIONS Bachelor’s which comes before it in the text I am splitting on.

I hope this all makes sense and I appreciate any assistance you may have to offer!

Hi @TardisPilot, can you provide examples of the text you’re trying to split?

Hi @elsamuel

Here is an example:

Expected to collaborate daily as you work through user stories and support products as they evolve. If you are our ideal candidate, you will have demonstrated technical and problem-solving skills; a passion for technology and software, and strong team skills. Responsibility Statements: Actively participate in the definition, design, development, testing, support and implementation of software functionalities Comfortable working on front-end web code, back end services and data stores Embrace, recommend and apply new technologies as needed Experience writing modern software deployed in the cloud Work on agile teams by participating in story grooming, estimation, enablers and driving them to closure Interact with engineers and other cross-functional teams such as Product Management, Release Engineering, Quality Assurance and Operations to develop innovative solutions that meet business needs with respect to functionality, performance, scalability, reliability and security Participate in projects as a member of an Agile/Scrum team including project estimation, task creation and driving to complete tasks in each sprint in a timely manner Work on efficient source code versioning, build and deployment practices with a goal of continuous deployment Adhere to technical standards and best practices Understand, measure and monitor performance against operational metrics QUALIFICATIONS Bachelor’s Degree in Computer Science, CIS, software engineering or a related field (STEM) 5+ years of IT experience developing and implementing business systems within an organization 4 + years of hands-on programming experience in Java/J2EE Strong experience with Spring and Spring Boot, Spring MVC, Spring Data, Spring Security Experience with Web Services (JSON, REST, JAX-RS, Spring based REST services) Strong understanding of Java concurrency, concurrency patterns, experience building thread safe code Experience with at least one of the development tools like Git, Gradle, Maven, Sonar, Jenkins, Artifactory, etc. Experience with web application servers like Tomcat, Jetty, JBoss, etc. Agile project experience along with working on Agile tools like JIRA Strong interpersonal skills and time management skills Strong analytical and troubleshooting skills PREFERRED QUALIFICATIONS 2 years’ experience in a retail environment or equivalent and relevant work experience 2 years’ experience in a cross functional team environment with exempt and non-exempt staff Working knowledge on Google cloud or any other cloud services Working knowledge on kafka or other messaging and streaming frameworks Working knowledge on noSQL databases like – Cassandra, Couchbase, Hadoop or MongoDB Knowledge of caching methodologies like Hazelcast or Redis Experience with TDD, code testability standards, JUnit/Mockito Experience with DevOps practices and CICD model of development Good understanding of OOP, design patterns and industry best practices.

What ends up happening is that the regex splits on the second instance of QUALIFICATIONS, ignoring the first. I just need the regex to act lazy in matching the elements in my OR list.

Hi @TardisPilot,

Using this regex:

(.*)(QUALIFICATIONS Bachelor’s|REQUIRED EDUCATION \/ EXPERIENCE|REQUIRED \(MINIMUM\) QUALIFICATIONS|QUALIFICATIONS)\b(.*)

The pattern matches the last occurrence because of the (.*) at the beginning. If you want it to match the first occurence, then use .*? at the beginning:

(.*?)(QUALIFICATIONS Bachelor’s|REQUIRED EDUCATION \/ EXPERIENCE|REQUIRED \(MINIMUM\) QUALIFICATIONS|QUALIFICATIONS)\b(.*)

:blush:

6 Likes

Hey @armingrudd,

Thank you for help, that solves it for me! I can’t believe I overlooked that!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.