Regular Expression for comparing words

svelma

New Member
Joined
Aug 2, 2011
Messages
14
Can somebody give me a regular expression to do an approximate, atleast 3 letter match between two words.

For example I have "Alex Mike" in one column and "mAlex" in another. There is a space in between Alex and Mike and we are comparing to mAlex. I think its tricky.

I tried using the following expressions:
[\w]*
[\w]{3,}?
[a-zA-Z]*
etc,
But I still don't find a match between some of the records. I have over 4000 records and I am trying to use Regex in demand tools with salesforce.

There is a fuzzy option in demand tools that avoids spaces. So, I even tried using that, but my regular expression needs some correction.
Please help me out.
Thanks,
Velma
 
Craig provided a Sub, I provided a a user-defined functon used as in the example I showed.

If Craig's works for you, use it.
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top