Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby regular expression for matching APA reference format
    primarykey
    data
    text
    <p>I need a regular expression that matches APA format references.</p> <p>I currently have this:</p> <pre><code>/([A-Z][a-zA-Z\-\:\'\s\´]{3,}\, ([a-zA-Z]\.[\s|,|.]| &amp;?){1,}){1,}\(\d\d\d\d(, [A-Z][a-z\- ]*\d\d?|)\)\.[a-zA-Z\-\:\'\s]{3,}\.[a-zA-Z\-\s]+\,[ ]*\d\d(\(\S\))*,\d+.\d+./ </code></pre> <p>It only catches 10 and is fragile as hell.</p> <p>I only need journal articles - not books, not non-english articles.</p> <p>Any tips on how to make this regex more manageable appreciated.</p> <p>I built it using <a href="http://www.rubular.com/" rel="nofollow noreferrer">Rubular</a></p> <p>This is the source data ( I know about the missing spaces and international character issues ):</p> <blockquote> <p>Bre´dart, S., Valentine, T., Calder, A., &amp; Gassi, L. (1995). An interactiveactivation model of face naming.Quarterly Journal of ExperimentalPsychology, 48(A),466–486.Bruce, V., &amp; Young, A. (1986). Understanding face recognition.BritishJournal of Psychology, 77,305–327.Burton, A. M., &amp; Bruce, V. (1992). I recognize your face but I can’tremember your name: A simple explanation?British Journal of Psy-chology, 83,45–60.Flude, B., Ellis, A., &amp; Kay, J. (1990). Face processing and name retrievalin an anomic aphasic: Names are stored separately from semanticinformation about people.Brain and Cognition, 11,60–72.Gratton, G., Coles, M. G. H., Sirevaag, E. J., Eriksen, C. W., &amp; Donchin,E. (1988). Pre- and poststimulus activation of response channels: Apsychophysiological analysis.Journal of Experimental Psychology: Hu-man Perception and Performance, 14,331–344.Hodges, J. R., &amp; Greene, J. D. W. (1998). Knowing about people andnaming them: Can Alzheimer’s disease patients do one without theother?Quarterly Journal of Experimental Psychology, 51(A),121–134.Huynh, H., &amp; Feldt, L. S. (1976). Estimation of the box correction fordegrees of freedom from sample data in the randomized block andsplit-plot designs.Journal of Educational Statistics, 1,69–82.Jasper, H. H. (1958). Report of the committee on methods of clinicalexamination in electroencephalography.Electroencephalography andClinical Neurophysiology, 10,370–375.Johnston, R. A., &amp; Bruce, V. (1990). Lost properties? Retrieval differencesbetween name codes and semantic codes for familiar people.Psycho-logical Research 52,62–67.Kornhuber, H. H., &amp; Deecke, L. (1965). Hirnpotentialaenderungen beiWillkuerbewegungen und passiven Bewegungen des Menschen: Be-reitschaftspotential und reafferente Potentiale [Brain potential changesfor voluntary and passive movements in humans: Readiness potentialand afferent potentials].Pfluegers Archiv fuer die Gesamte Physiologie,284,1–17.Kutas, M., &amp; Donchin, E. (1974, November 8). Studies of squeezing:Handedness, responding hand, response force, and asymmetry of readi-ness potential.Science, 186,545–547.Kutas, M., &amp; Donchin, E. (1980). Preparation to respond as manifested bymovement-related brain potentials.Brain Research, 202,95–115</p> </blockquote> <p>Examples of book references that mess up mletterle's answer</p> <pre><code>Lippold, O. C. J. (1967). Electromyography. In P. H. Venables &amp; I. Martin (Eds.), A manual of psychophysiological methods (pp. 245–298). Amsterdam: North-Holland. Low, K. A., &amp; Miller, J. (1999). The usefulness of partial information: Effects of go probability in the choice/nogo task. Psychophysiology, 36, 288–297. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload