I've been dealing with this problem which has gotten me stumped - and I figure there has to be a way to do this simply with a regex rather than write a seperate function.... here's my jam...
I've had to deal with a stack of values who's occurrence is as follows:
AA40772C192C56C338C001C001CF1F4F3F2338C001C001CF1F2F3F8184C52C000
Now - the trifle is as follows.....
This is a stack of values that are all delimited by the character "C". However, for all fields beginning with "338" - there is no field delimiter - the values starting with 338 have a standard format as follows:
338C\d\d\dC\d\d\dC\S\S\S\S\S\S\S\S
What I want to do is replace this pattern with the same pattern with a C appended to it within the string... so I tried using the follwing regex:
s/
338C\d\d\dC\d\d\dC\S\S\S\S\S\S\S\S
/
338C\d\d\dC\d\d\dC\S\S\S\S\S\S\S\S
C/
g
The only problem is.... although it inserts the "C" delimiters, the regex has wipes out the pertinent data of the digits and the "F"s - - is there a simple regex I can use to accomplish this?
Any help will be much appreciated! Thanks is advance!
/Gridlock a.k.a. Debashis
"Codito Ergo Sum"