Match Strings using REFind

Thread Solved

Join Date: Jun 2008
Posts: 28
Reputation: cheapterp is an unknown quantity at this point 
Solved Threads: 2
cheapterp's Avatar
cheapterp cheapterp is offline Offline
Light Poster

Match Strings using REFind

 
0
  #1
Jul 31st, 2009
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!
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: Match Strings using REFind

 
1
  #2
Aug 2nd, 2009
Why do you need regex for this? Can you not use basic string functions like LEFT, MID, and RIGHT?
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 28
Reputation: cheapterp is an unknown quantity at this point 
Solved Threads: 2
cheapterp's Avatar
cheapterp cheapterp is offline Offline
Light Poster

Re: Match Strings using REFind

 
0
  #3
Aug 5th, 2009
Thanks buddylee17,
I am not sure why I did not think of those functions!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC