This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am using the regex tool to parse a string instead of using the split tool because the delimiter has to be a space and a hyphen (hyphens can be used later in the string without a space so it has to include the space to be a delimiter): Here is the regex that I am using
Most of the time it works, but about 5 out of 200 are not parsing correctly. I attached a small sample with the labels replaced of the input and output that I am getting.
Any thoughts on why it would not be parsing in these few instances would be welcomed!
As @Thableaus mentioned, the REGEX you provided does seem to work. However, I'd suggest making some adjustments. Use + instead of * to ensure it matches at least 1 character. I also noticed that there's an additional space before the hyphen that your pattern was not looking for.
I went through the later part of the label that I had to remove and found that in about 1%, the users inputting the data had manually added a hyphen and a space which was throwing off the formula. We will have to clean up the data input to make it work correctly.