As an example, here are the first few lines of a MARC record in my file.
=LDR 01468cam a2200349Ia 4500
=001 ocn675930325
=003 OCoLC
=005 20130211115710.0
=006 m\\\\\o\\d\f\\\\\\
=007 cr\bn|||||||||
=008 101031s1849\\\\ht\\\\\\ol\\\f000\0\fre\d
=035 \\$a(OCoLC)675930325
=037 \\$a31-768$bLLMC
I would expect
=008.*\r?\n
to match the entire 008 field, yet I get no match. I do get a match on
=008.*\z
On 8/3/2016 2:51 PM, Terry Reese wrote:
> The /m does work in specific instances. The \r\n sequence though isn't always true. It's easier to look for \r?\n
>
> tr
>
> -----Original Message-----
> From: MarcEdit support in technical and instructional matters [mailto:[log in to unmask]] On Behalf Of Andy Boze
> Sent: Wednesday, August 3, 2016 1:59 PM
> To: [log in to unmask]
> Subject: [MARCEDIT-L] Searching record for multiple fields using regex
>
> I'm trying to find records that contain two fields. I've used the video at <https://www.youtube.com/watch?v=qNJA9p2_-qU> for guidance, but my search doesn't seem to work as expected.
>
> Let's say I want to find records containing a 008 field immediately followed by a 035 field. I would expect to get matches using the following regex.
>
> =008.*\r\n=035/m
>
> No match. Interestingly, when I try just
>
> =008.*\r\n
>
> I get no match. If I instead use
>
> =008.*\z
>
> I get a match for the entire 008 field. That's good. But if I try
>
> =008.*\z=035/m
>
> I get no match. In fact, if I try
>
> =008.*\z/m
>
> I get no match. So I'm wondering, is the /m no longer indicating a multi-field search? And does \r\n no longer indicate end of field, and \z must be used instead?
>
> I'll just mention that what I really want to do is search for a 008 field containing a character at a specific location, followed somewhere later by an 856 field containing a specific string. I'm sure I can figure that out if I can just get the example above with the 008 and 035 fields to work.
>
> Thanks for any assistance!
>
> --
> Andy Boze, Associate Librarian
> University of Notre Dame
> 208 Hesburgh Library
> (574) 631-8708
>
> ________________________________________________________________________
>
> 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]
>
--
Andy Boze, Associate Librarian
University of Notre Dame
208A Hesburgh Library
(574) 631-8708
________________________________________________________________________
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]
|