I'm comparing two strings to see if they refer to the same movie title. One string is the clean title and one is the title with lots of other info. For example when compared they should return TRUE if actually the same movie.
SAME TITLE:
sCleanTitle = "2 Wrinkles: in Time #2"
sNotCleanTitle = "LLP 2 Wrinkles in Time (DVD) - #2"
SAME TITLE:
sCleanTitle = "YOUR MOTHER'S HOUSE"
SNotClean = "NSP - Your Mothers House - VHS -"
FYI- there is no pattern of how the sNotClean could be. the Version Number might not be at the end. it could be like this: sNotCleanTitle = "LLP 2 Wrinkles in Time #2 - (DVD)" . sCleanTitle will always have the version number at the end if it HAS a version #.
So I think basically I to compare them I need to UCase them, Trim them, get rid of all the characters except the # and then InStr the title and the version number (including the #) if there is a version number. Maybe?
sVersionNum = "#2"
sTitle = "2 WRINKLES IN TIME" <--Got rid of all extra characters
If InStr(sNotCleanTitle, sVersionNum) > 0 and InStr(sNotCleanTitle, sTitle) Then
bTheSame = TRUE
End If
I don't know regular expression well enough to pull out the info I need. So I need a solution on how to pull out sTitle and sVersionNum for the sCleanTitle or any other suggestions of how to compare the strings!
thanks!
Christa
Start Free Trial