H
Hal Vaughan
I know this is simpler than I'm making it out to be, but maybe I've just not
had enough sleep lately. I have data coming to me that has already been
pulled off a VT102 display. Normally the display reads:
MAILADR 1234 Some Street, Rd.
Previously the data that was coming in used to be clean. There was no extra
data so it was just a matter of making sure the spaces at the start and end
were cleared. Now sometimes I get it with "R" at the start of the data,
like this:
R 1234 Some Street, Rd.
And sometimes it's ADR or DR at the start. I keep thinking one regex should
work to pull out MAILADR, AILADR, ILADR, and so on from the start, but I
keep missing it.
I can just use different regexes, but it's bugging me now. Isn't there a
quick way to do this? I know if I try:
$data =~ s/^M*A*I*L*A*D*R* *//
it will usually do the trick, but it could get other expressions as well so
what I don't get is making sure it pulls only R or only DR or ADR and so
on.
This is fairly simple, right? Or am I confused because of lack of sleep?
Thanks for a pointer in some direction or help or anything else!
Hal
had enough sleep lately. I have data coming to me that has already been
pulled off a VT102 display. Normally the display reads:
MAILADR 1234 Some Street, Rd.
Previously the data that was coming in used to be clean. There was no extra
data so it was just a matter of making sure the spaces at the start and end
were cleared. Now sometimes I get it with "R" at the start of the data,
like this:
R 1234 Some Street, Rd.
And sometimes it's ADR or DR at the start. I keep thinking one regex should
work to pull out MAILADR, AILADR, ILADR, and so on from the start, but I
keep missing it.
I can just use different regexes, but it's bugging me now. Isn't there a
quick way to do this? I know if I try:
$data =~ s/^M*A*I*L*A*D*R* *//
it will usually do the trick, but it could get other expressions as well so
what I don't get is making sure it pulls only R or only DR or ADR and so
on.
This is fairly simple, right? Or am I confused because of lack of sleep?
Thanks for a pointer in some direction or help or anything else!
Hal