View Full Version : A question regarding RegExp
Is it possible using regExp to check that the numbers in string1 exist in string2 and are in the same order irrespective of the fact that there might be other non-numerical characters mixed in with them
04-17-2005, 07:52 PM
yes you can.
feel like providing an example to work from?
As you can see the numbers in string 1 are in the same order as in string 2 even though there are other characters present in both strings.
str1 = "6/3 9-38-4 2/0"
str2 = "6-3/93-as84/2-0"
so I am looking to see if 63938420 exists in both strings and in that order
The numbers themselves may change in value but should be the same in both strings and in the same order
str1="8-/3 - 6/-2 sd 7bg4"
str2="8at/3-6 2// 7-4"
836274 should exist in both string in the same order
04-17-2005, 09:14 PM
Thank you it worked a treat :thumbsup:
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.