use strict;
my $str = 'MIT Sample:
SOME ASPECTS OF RADIATION INDUCED NUCLEATION IN WATER
by
Chih-Ping Tso
B.Tech., Loughborough University of Technology, United Kingdom
(1968)
Submitted in Partial Fulfillment of
the Requirements for the Degree of
Master of Science
at the
Massachusetts Institute of Technology
August 1970
Signature of Author
Department of Nuclear Engineering
Certified by
Thesis Supervisor
Accepted by
Chairman, Departmental Committee
Archives on Graduate Students
MASS. INST. TECH.
SEP 21 1970
LIBRARIES
----------------------------------------------
Virginia Tech Sample:
FORMATTING VARIABLES AND TYPEFACE VARIATIONS
OF
DOT-MATRIX PRINT AND THEIR EFFECT
ON
READING COMPREHENSION AND READING SPEED
by
James A. Holmes
Dissertation submitted to the Faculty of the
Virginia Polytechnic Institute and State University
in partial fulfillment of the requirements for the degree of
DOCTOR OF EDUCATION
in
Vocational and Technical Education
March, 1986
Blacksburg, Virginia';
my $regex = qr/(?<=by\n)\w.+/mp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html