So what's this for?
if u rly wanna know
2:36 AM - Foxscotch: regex is THE BEST
2:36 AM - [TPN] Steve5451: i use it sometimes
2:36 AM - [TPN] Steve5451: but it's confusing and i have to google it
2:37 AM - Foxscotch: it's not that confusing to me but there is a lot of stuff to remember
2:37 AM - [TPN] Steve5451: I've never learned it so it's confusing for me.
2:37 AM - [TPN] Steve5451: i put out a massive user blocker update the other day
2:38 AM - Foxscotch: the other day I had a big long list of stuff
2:38 AM - Foxscotch:
dc = Part(model=qfa, number='29134-2T000', name='AIR GUARD RH '); dc.save()
dd = Part(model=qfa, number='29136-2T000', name='AIR GUARD LH'); dd.save()
de = Part(model=qfa, number='1059508', name='HTR MNL'); de.save()
df = Part(model=qfa, number='1059512', name='HTR DATC '); df.save()
dg = Part(model=qfa, number='1059453', name='SHOWER DUCT LH'); dg.save()
dh = Part(model=qfa, number='1059455', name='SHOWER DUCT RH'); dh.save()
di = Part(model=qfa, number='1059545', name='BLWR '); di.save()
dj = Part(model=qfa, number='D108TcigaretteA01', name='LOWER'); dj.save()
2:38 AM - Foxscotch: that's the end result
2:39 AM - Foxscotch: but BEFORE, the "; x.save()" part was not there on any of them
2:39 AM - Foxscotch: and I used regex to add it to all of them
2:39 AM - Foxscotch: there is a lot of them steve
2:39 AM - Foxscotch: it goes like
2:39 AM - [TPN] Steve5451: but what is it? o:
2:39 AM - Foxscotch: a, b, c, d ... aa, ab, ac ... dh, di, dj
2:39 AM - [TPN] Steve5451: how high does it go?
2:40 AM - Foxscotch: dj is the last one
2:40 AM - [TPN] Steve5451: ah
2:40 AM - Foxscotch: the only issue with that was when I got to "as" I had to change it to "ast" bc "as" is a keyword in python
2:40 AM - Foxscotch: and it's for something for work
2:41 AM - Foxscotch: step 1 was to match the first bit, the stuff that was already there, and then I had to replace it with that PLUS the bit at the end
2:41 AM - Foxscotch: the pattern for matching it was like
2:45 AM - Foxscotch: ([a-z]{1,2}) = Part\(model=[a-z]{0,3}, number='[A-z0-9]{1,25}', name='[A-z /\-,]{1,25}'\)
2:46 AM - Foxscotch: but the substitution string was really simple
2:46 AM - Foxscotch: $&; $1.save()
2:47 AM - Foxscotch: $& places the entire matched string, and $1 places the first group from the matched string, which was ([a-z]{1,2})