Just starting (hopefully) to get my head around regular expressions when I have come across a real life problem where I am not sure if they can be utilised.
I am receiving in a message a fixed length fixed format string. I wondered if I could use a regular expression to easily extract the information. I know I can do it by straightforward string manipulation but I thought I may have an opportunity to use regular expressions.
e.g. "AAAABBBCCCCC"
I would like a regular expression that produced a match collection containing
AAAA
BBB
CCCCC
where A,B and C are any alphanumeric character. I need to extract the first 4 characters as the first match, the next 3 as the second, the next 5 asthe third and so on.
I am using the RegExp class provided by VBScript, in case that has any relevance to a possible solution.
TIA
I am receiving in a message a fixed length fixed format string. I wondered if I could use a regular expression to easily extract the information. I know I can do it by straightforward string manipulation but I thought I may have an opportunity to use regular expressions.
e.g. "AAAABBBCCCCC"
I would like a regular expression that produced a match collection containing
AAAA
BBB
CCCCC
where A,B and C are any alphanumeric character. I need to extract the first 4 characters as the first match, the next 3 as the second, the next 5 asthe third and so on.
I am using the RegExp class provided by VBScript, in case that has any relevance to a possible solution.
TIA
Comment