943,630 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Marked Solved
  • Views: 2759
  • ColdFusion RSS
Jul 31st, 2009
0

Match Strings using REFind

Expand Post »
I have a bunch of alphanumeric IDs for the data in my DB. The IDs may look like the foll:
0XAA001 or 1YBB010 or 2ZCC011 and so on.

Each of the 7 characters stands for something and therefore I have to extract the characters to populate the columns in the DB. I was able to use the REFind function (with the ^ special character) to grab the first 2 characters.

Extracting the subsequent characters is giving me trouble. What I want to do next is extract the 3rd and 4th characters (simultaneously) and do a comparison. Based on whether the pair is AA or BB etc, I have to populate a column in the DB.

How do I pull out the remaining characters - two at a time?

TIA!
Similar Threads
Reputation Points: 10
Solved Threads: 2
Light Poster
cheapterp is offline Offline
33 posts
since Jun 2008
Aug 2nd, 2009
1

Re: Match Strings using REFind

Why do you need regex for this? Can you not use basic string functions like LEFT, MID, and RIGHT?
Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007
Aug 5th, 2009
0

Re: Match Strings using REFind

Thanks buddylee17,
I am not sure why I did not think of those functions!
Reputation Points: 10
Solved Threads: 2
Light Poster
cheapterp is offline Offline
33 posts
since Jun 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: Send a text message to your phone from your site!
Next Thread in ColdFusion Forum Timeline: Mass-update table data with a single query?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC