How can I use regex to solve this?

awaissalman

New Member
I have two strings that I need to pull data out of but can't seem to get it working. I wish I knew regular expression but unfortunately I don't. I have read some beginner tutorials but I can't seem to find an expression that will do what I need.Out of this first string delimited by the equal character, I need to skip the first 6 characters and grab the following 9 characters. After the equal character, I need to grab the first 4 characters which is a day and year. Lastly for this string, I need the remaining numbers which is a date in YYYYmmdd.\[code\]636014034657089=130719889904\[/code\]The second string seems a little more difficult because the spaces between the characters differ but always seem to be delimited by at minimum, a single space. Sometimes, there are as many as 15 or 20 spaces separating the blocks of data.Here are two different samples that show the space difference.\[code\]!!92519 C 01 M600200BLNBRN D55420090205M1O!!95815 A M511195BRNBRN D62520070906 ":%/]Q2#0*&\[/code\]The data that I need out of these last two strings are:\[code\]The zip code following the 2 exclamation marks.The single letter 'M' following that. It always appears to be in a 13 character blockThe 3 numbers after the single letterThe next 3 numbers which are the person's heightThe following next 3 are the person's weightThe next 3 are eye colorThe next block of 3 which are the person's hair color\[/code\]The last block that I need data from:I need to get the single letter which in the example appears to be a 'D'.Skip the next 3 numbersThe last and remaining 8 numbers which is a date in YYYYmmddIf someone could help me resolve this, I'd be very grateful.
 
Back
Top