That’s not working for me. Here is a little more context. What I’m trying to do is replace some old vlookup that was combines with some regex logic in my sheet. What’s supposed to happen is that I take a competition name, that includes a year, strip off the year, and then ultimately use that stripped value to create a relation to an Images resource table. The competition is year based, but the image for each particular competition remains the same. This allows a user to create a new competition record, with a name that includes the year, but pulls from the same images resource.
This is what I am using. It extracts everything BUT the year, which is what I want. But it obviously still includes the space between the year and the rest of the string, because it’s not numeric.
Using your regex, it instead returns only the decimal digits and the space, which is the opposite of what I’m looking for.
Hope that makes mores sense. Right now, I can take the regex result from (\D+) and then use the trim plugin, so I’m completely fine with that method, but I wanted to see if I could do it all within the regex extract.
Sometimes I get into a rabbit hole where something seems so dang simple, and I keep searching and trying things without making any progress. Eventually, I begin to question myself, and begin to wonder if what I’m trying to do is even possible.
haha, yes I can relate to that. In times like that, I find that setting it aside for a while and working on something else almost always helps. Or go for a walk, or sleep on it. Then come back at it with a fresh mind. Inevitably, I find the answer staring me in the face
As an aside, of those two regex options above, the first would be (ever so) slightly more efficient. That’s because it will stop as soon as it hits the first non-matching character, whereas the second will continue to the end of the string.
I’ll have to check out that book. We use a very small amount of regex at work, and at most, only a couple of the other developers deal with that stuff, so I’ve never had to touch it. Now SQL…on the other hand…I’ve done some crazy things with that.