Thanks Terry. I think this will work. The data I listed *is* all the data in the subfield (in this case, 260$c).
Jeff
----- Original Message -----
From: "Terry Reese" <[log in to unmask]>
To: [log in to unmask]
Sent: Thursday, July 21, 2016 1:00:08 PM
Subject: Re: [MARCEDIT-L] regex help
I haven't had a chance to try it -- but assuming that this is like data in the single subfield -- you could use something like:
(.*)(\d{4})(.*)
Or
(.*)([0-9]{4})(.*)
And then keep just the data in $2.
That assumes that this is all the data in the subfield. If it isn't, then this would get, much, much harder.
--tr
-----Original Message-----
From: MarcEdit support in technical and instructional matters [mailto:[log in to unmask]] On Behalf Of Jeff Edmunds
Sent: Thursday, July 21, 2016 12:54 PM
To: [log in to unmask]
Subject: [MARCEDIT-L] regex help
Can anyone suggest a regex that would flip several flavors of inconsistent date date into simply YYYY?
In other words, I have
1968
Jan 1968
Jul 1967
Mar 1965
"1 Mar 1966"
"31 Apr. 1968"
Sep. 1966
and I want to end up with
1968
1968
1967
1965
1966
1968
1966
Stated differently, I want to strip out everything but the (always 4-digit) year. There are no other instances of 4 consecutive digits in the data.
Thanks,
Jeff
________________________________________________________________________
This message comes to you via MARCEDIT-L, a Listserv(R) list for technical and instructional support in MarcEdit. If you wish to communicate directly with the list owners, write to [log in to unmask] To unsubscribe, send a message "SIGNOFF MARCEDIT-L" to [log in to unmask]
________________________________________________________________________
This message comes to you via MARCEDIT-L, a Listserv(R) list for technical and instructional support in MarcEdit. If you wish to communicate directly with the list owners, write to [log in to unmask] To unsubscribe, send a message "SIGNOFF MARCEDIT-L" to [log in to unmask]
________________________________________________________________________
This message comes to you via MARCEDIT-L, a Listserv(R) list for technical and instructional support in MarcEdit. If you wish to communicate directly with the list owners, write to [log in to unmask] To unsubscribe, send a message "SIGNOFF MARCEDIT-L" to [log in to unmask]
|