Compare numeric parts of two cells with RegexMatch

#1

I have different URLs in A and B. URLs have different length and nested structure, but all of them have a part /id/any-number/.

I want to compare their IDs (their numeric values) in any way like this:

IF((A2{\d}=B2{\d}),true,false)

Is this anyhow possible with RegexMatch?

#2

Sure, I would recommend RegexFind to get the strings. You can also skip the If(x,true, false) statement, it will automatically evaluate bool if you compare two IDs.

So, how about =RegexpFind(A2,regex)=RegexpFind(B2,regex)

#3

hmm, =RegexpFind(A2,\d)=RegexpFind(F2,\d) fires #VALUE :frowning:

#4

You need quotes for the regex string. RegexFind(A2,"\d+"). You can post two example Urls and I can create valid formulas if you can't get it to work.

1 Like