100% found this document useful (1 vote)
7 views

Regex Quick Syntax Reference: Understanding and Using Regular Expressions Zsolt Nagy download

The document is a reference guide for understanding and using regular expressions, authored by Zsolt Nagy. It covers various topics including regex syntax, execution in different programming languages, and optimization techniques. The document also includes practical examples and insights into the importance of regular expressions in programming.

Uploaded by

karepisaeba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
7 views

Regex Quick Syntax Reference: Understanding and Using Regular Expressions Zsolt Nagy download

The document is a reference guide for understanding and using regular expressions, authored by Zsolt Nagy. It covers various topics including regex syntax, execution in different programming languages, and optimization techniques. The document also includes practical examples and insights into the importance of regular expressions in programming.

Uploaded by

karepisaeba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Regex Quick Syntax Reference: Understanding and

Using Regular Expressions Zsolt Nagy pdf


download

https://ebookmeta.com/product/regex-quick-syntax-reference-
understanding-and-using-regular-expressions-zsolt-nagy-2/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Regex Quick Syntax Reference: Understanding and Using


Regular Expressions Zsolt Nagy

https://ebookmeta.com/product/regex-quick-syntax-reference-
understanding-and-using-regular-expressions-zsolt-nagy-2/

Java 17 Quick Syntax Reference 3rd Edition Mikael


Olsson

https://ebookmeta.com/product/java-17-quick-syntax-reference-3rd-
edition-mikael-olsson/

JavaScript Regular Expressions Leverage the power of


regular expressions to create an engaging user
experience 1st Edition Loiane Groner Gabriel Manricks

https://ebookmeta.com/product/javascript-regular-expressions-
leverage-the-power-of-regular-expressions-to-create-an-engaging-
user-experience-1st-edition-loiane-groner-gabriel-manricks/

The Role of the Supreme Court in American Government


and Politics 1835 1864 Charles Grove Haines

https://ebookmeta.com/product/the-role-of-the-supreme-court-in-
american-government-and-politics-1835-1864-charles-grove-haines/
Causal Inference in Python: Applying Causal Inference
in the Tech Industry (Fourth Early Release) 4th Edition
Matheus Facure

https://ebookmeta.com/product/causal-inference-in-python-
applying-causal-inference-in-the-tech-industry-fourth-early-
release-4th-edition-matheus-facure/

The CANTERBURY TALES and the Good Society Paul A. Olson

https://ebookmeta.com/product/the-canterbury-tales-and-the-good-
society-paul-a-olson/

Geography Art Research Artistic Research in the


GeoHumanities 1st Edition Harriet Hawkins

https://ebookmeta.com/product/geography-art-research-artistic-
research-in-the-geohumanities-1st-edition-harriet-hawkins/

Jurisdiction and Admissibility in Investment


Arbitration The Practice and the Theory 1st Edition
Filippo Fontanelli

https://ebookmeta.com/product/jurisdiction-and-admissibility-in-
investment-arbitration-the-practice-and-the-theory-1st-edition-
filippo-fontanelli/

A Season of Monstrous Conceptions 1st Edition Lina


Rather

https://ebookmeta.com/product/a-season-of-monstrous-
conceptions-1st-edition-lina-rather-2/
How the Immune System Works 6th Edition Lauren M.
Sompayrac

https://ebookmeta.com/product/how-the-immune-system-works-6th-
edition-lauren-m-sompayrac/
Regex Quick
Syntax
Reference
Understanding and
Using Regular Expressions

Zsolt Nagy
Regex Quick Syntax
Reference
Understanding and Using
Regular Expressions

Zsolt Nagy
Regex Quick Syntax Reference: Understanding and Using Regular Expressions
Zsolt Nagy
Berlin, Germany

ISBN-13 (pbk): 978-1-4842-3875-2      ISBN-13 (electronic): 978-1-4842-3876-9


https://doi.org/10.1007/978-1-4842-3876-9
Library of Congress Control Number: 2018953563
Copyright © 2018 by Zsolt Nagy
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail editorial@apress.com; for reprint, paperback, or
audio rights, please email bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available
to readers on GitHub via the book’s product page, located at www.apress.com/9781484238752.
For more detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper
Table of Contents
About the Author���������������������������������������������������������������������������������ix

About the Technical Reviewer�������������������������������������������������������������xi

Chapter 1: An Introduction to Regular Expressions�����������������������������1


Why Are Regular Expressions Important?�������������������������������������������������������������1
What Are Regular Expressions?����������������������������������������������������������������������������2
Frustrations with Regular Expressions Arise from Lack of Taking Action�������������4
Regular Expressions Are Imperative���������������������������������������������������������������������5
The Language Family of Regular Expressions������������������������������������������������������6
Summary��������������������������������������������������������������������������������������������������������������8

Chapter 2: Regex Syntax 101���������������������������������������������������������������9


Formulating an Expression�����������������������������������������������������������������������������������9
Literal Characters and Meta Characters��������������������������������������������������������10
Arbitrary Character Class������������������������������������������������������������������������������������13
Basic Concatenation�������������������������������������������������������������������������������������������14
Alternative Execution������������������������������������������������������������������������������������������14
Operator Precedence and Parentheses��������������������������������������������������������������15
Anchored Start and End��������������������������������������������������������������������������������������15
Modifiers�������������������������������������������������������������������������������������������������������������19
Summary������������������������������������������������������������������������������������������������������������21

iii
Table of Contents

Chapter 3: Executing Regular Expressions�����������������������������������������23


Regular Expressions in JavaScript����������������������������������������������������������������������23
RegExp Methods��������������������������������������������������������������������������������������������25
String Methods Accepting Regular Expressions��������������������������������������������26
Regex Modifiers���������������������������������������������������������������������������������������������27
Global Matches����������������������������������������������������������������������������������������������28
Multiline Matches������������������������������������������������������������������������������������������30
ES6 Unicode Regular Expressions�����������������������������������������������������������������31
Sticky Matches����������������������������������������������������������������������������������������������32
Summary�������������������������������������������������������������������������������������������������������34
Other PCRE-Based Regex Environments�������������������������������������������������������������34
PHP����������������������������������������������������������������������������������������������������������������35
Python�����������������������������������������������������������������������������������������������������������37
Perl 5�������������������������������������������������������������������������������������������������������������40
Java���������������������������������������������������������������������������������������������������������������41
R��������������������������������������������������������������������������������������������������������������������43
C#������������������������������������������������������������������������������������������������������������������44
Ruby��������������������������������������������������������������������������������������������������������������46
Golang�����������������������������������������������������������������������������������������������������������48
C++���������������������������������������������������������������������������������������������������������������49
Summary�������������������������������������������������������������������������������������������������������51

Chapter 4: Visualizing Regex Execution Using Finite


State Machines�����������������������������������������������������������������53
Regular Expressions Are Finite State Machines��������������������������������������������������53
Backtracking�������������������������������������������������������������������������������������������������������55
Deterministic and Nondeterministic Regex Modeling�����������������������������������������56

iv
Table of Contents

Basic Regex Simplifications��������������������������������������������������������������������������������62


A Successful Match Is Cheaper Than Failure������������������������������������������������������63
Automatically Generating Regex FSMs���������������������������������������������������������������63
Summary������������������������������������������������������������������������������������������������������������66

Chapter 5: Repeat Modifiers���������������������������������������������������������������67


Backtracking�������������������������������������������������������������������������������������������������������68
Match at Least Once�������������������������������������������������������������������������������������������70
Match at Most Once: Optionals���������������������������������������������������������������������������72
Match Any Number of Times�������������������������������������������������������������������������������73
Fixed-Range Matching����������������������������������������������������������������������������������������74
Loop Exactly n Times������������������������������������������������������������������������������������������77
Greedy Repeat Modifiers�������������������������������������������������������������������������������������78
Lazy Repeat Modifiers����������������������������������������������������������������������������������������79
Possessive Repeat Modifiers������������������������������������������������������������������������������82
Summary������������������������������������������������������������������������������������������������������������84

Chapter 6: Character Sets and Character Classes������������������������������85


Character Sets����������������������������������������������������������������������������������������������������85
Character Set Ranges�����������������������������������������������������������������������������������������87
Exclusions from Character Sets��������������������������������������������������������������������������88
Character Set Classes�����������������������������������������������������������������������������������������88
Concatenating Advanced Language Constructs��������������������������������������������������92
Summary������������������������������������������������������������������������������������������������������������93

Chapter 7: Substring Extraction from Regular Expressions���������������95


Defining Capture Groups�������������������������������������������������������������������������������������96
Perl 6 Capture Groups�����������������������������������������������������������������������������������������97

v
Table of Contents

Retrieval of Captured Substrings������������������������������������������������������������������������98


JavaScript����������������������������������������������������������������������������������������������������100
PHP��������������������������������������������������������������������������������������������������������������101
Python���������������������������������������������������������������������������������������������������������102
Perl 5�����������������������������������������������������������������������������������������������������������103
Reusing Captured Substrings Within a Regex���������������������������������������������������104
Capture Groups and Performance���������������������������������������������������������������������106
Extensions to Capture Groups���������������������������������������������������������������������������108
Summary����������������������������������������������������������������������������������������������������������108

Chapter 8: Lookahead and Lookbehind��������������������������������������������109


Lookahead��������������������������������������������������������������������������������������������������������109
Lookbehind�������������������������������������������������������������������������������������������������������112
Summary����������������������������������������������������������������������������������������������������������113

Chapter 9: Maintaining Regular Expressions�����������������������������������115


Extended Mode�������������������������������������������������������������������������������������������������116
Regex Subroutines��������������������������������������������������������������������������������������������118
PCRE Subroutines����������������������������������������������������������������������������������������119
Perl 6 Subroutines���������������������������������������������������������������������������������������120
Recursion and Circular References with Subroutines���������������������������������121
Extended Mode, Subroutines, and Abstractions������������������������������������������121
Named Capture Groups�������������������������������������������������������������������������������������122
EMACS Named Capture Groups�������������������������������������������������������������������122
PCRE Named Capture Groups����������������������������������������������������������������������122
Perl 6 Named Capture Groups���������������������������������������������������������������������125
Case Study: XRegExp Library for JavaScript�����������������������������������������������������125
Summary����������������������������������������������������������������������������������������������������������128

vi
Table of Contents

Chapter 10: Optimizing Regular Expressions�����������������������������������131


Summary of the Optimization Techniques��������������������������������������������������������132
Making Character Classes More Specific���������������������������������������������������������132
Repeating Character Class Loops���������������������������������������������������������������������134
Use Possessive Repeat Modifiers Whenever Possible��������������������������������������135
Use Atomic Groups��������������������������������������������������������������������������������������������136
Refactor for Optimization����������������������������������������������������������������������������������138
Optimization Techniques Limit Nondeterministic Execution�����������������������������138
Summary����������������������������������������������������������������������������������������������������������139

Chapter 11: Parsing HTML Code and URL Query Strings


with Regular Expressions���������������������������������������������141
Parsing HTML Tags��������������������������������������������������������������������������������������������141
Processing the Query String of a URL���������������������������������������������������������������144

Afterword: This Is Not the End, but the Beginning����������������������������147


“What If I Want to Learn More?”�����������������������������������������������������������������������149
Keep in Touch����������������������������������������������������������������������������������������������������150

Index�������������������������������������������������������������������������������������������������151

vii
About the Author
Zsolt Nagy is a web development team
lead, mentor, and software engineer living
in Berlin, Germany. He programs with
JavaScript, Perl, and other open source
web technologies. Zsolt is also experienced
in using and teaching regular expressions
using these technologies. He writes a blog
about lessons learned while solving complex
problems, experimenting with technology,
and teaching other people how to improve
their skills. As a software engineer, he continuously challenges himself to
stick to the highest possible standards.
You can read regular articles from me on

–– zsoltnagy.eu, a blog on writing maintainable web applications


–– devcareermastery.com, a career blog on designing a fulfilling
career

Sign up to my e-mail list for regular free content. I am the author of


these two books:

–– E S6 in Practice: The Complete Developer’s Guide (https://


leanpub.com/es6-in-practice)
–– The Developer’s Edge: How to Double Your Career Speed with
Soft-Skills (https://leanpub.com/thedevelopersedge)
Check them out if these topics are interesting to you.

ix
About the Technical Reviewer
Massimo Nardone has a master of science
degree in computing science from the University
of Salerno, Italy, and has more than 24 years of
experience in the areas of security, web/mobile
development, cloud, and IT architecture.
His IT passions are security and Android.
Specifically, he has worked as a project
manager, software engineer, research engineer,
chief security architect, information security
manager, PCI/SCADA auditor, and senior lead
IT security/cloud/SCADA architect.
He has also worked as a visiting lecturer and supervisor for exercises at
the Networking Laboratory of the Helsinki University of Technology (Aalto
University), and he holds four international patents (in the PKI, SIP, SAML,
and proxy areas).
He currently works as the chief information security officer (CISO) for
Cargotec Oyj and is a member of the ISACA Finland Chapter board.
Massimo has reviewed more than 45 IT books for different publishing
companies and is the coauthor of Pro JPA 2 in Java EE 8 (Apress, 2018),
Beginning EJB in Java EE 8 (Apress, 2018), and Pro Android Games
(Apress, 2015).

xi
CHAPTER 1

An Introduction to
Regular Expressions
I still remember my doomed encounters with regular expressions back
when I tried to learn them. In fact, I took pride in not using regular
expressions. I always found a long workaround or a code snippet. I
projected and blamed my own lack of expertise on the hard readability of
regular expressions. This process continued until I was ready to face the
truth: regular expressions are powerful, and they can save you a lot of time
and headache.
Fast-forward a couple of years. People I worked with encountered the
same problems. Some knew regular expressions, and others hated them.
Among the haters of regular expressions, it was quite common that they
actually liked the syntax and grammar of their first programming language.
Some developers even took courses on formal languages. Therefore,
I made it my priority to show everyone a path toward their disowned
knowledge to master regular expressions.

Why Are Regular Expressions Important?


In today’s world, we have to deal with processing a lot of data. Accessing
data is not the main problem. Filtering data is. Regular expressions provide
you with one type of filter that you can use to extract relevant data from

© Zsolt Nagy 2018 1


Z. Nagy, Regex Quick Syntax Reference, https://doi.org/10.1007/978-1-4842-3876-9_1
Chapter 1 An Introduction to Regular Expressions

the big chunks of data available to you. For instance, suppose you have an
XML file containing 4GB of data on movies. Regular expressions make it
possible to query this XML text so that you can find all movies that were
filmed in Budapest in 2016, for instance.
Regular expressions are a must-have for software developers.
In front-end development, we often validate input using regular
expressions. Many small features are also easier with regular expressions,
such as splitting strings, parsing input, and matching patterns.
When writing backend code, especially in the world of data science,
we often search, replace, and process data using regular expressions. In IT
infrastructure, regular expressions have many use cases. VIM and EMACS also
come with regex support for finding commands, as well as editing text files.
Regular expressions are everywhere. These skills will come handy for
you in your IT engineering career.

What Are Regular Expressions?


Regular expressions, or regexes, come from the theory of formal languages.
In theory, a regex is a finite character sequence defining a search pattern.
We often use these search patterns to
–– Test whether a string matches a search expression

–– Find some characters in a string

–– Replace substrings in a string matching a regex

–– Process and format user input

–– Extract information from server logs, configuration


files, and text files

–– Validate input in web applications and in the


terminal

2
Chapter 1 An Introduction to Regular Expressions

A typical regular expression task is matching. I will now use JavaScript


to show you how to test-drive regular expressions because almost everyone
has access to a browser. In the browser, you have to open the Developer
Tools. In Google Chrome, you can do this by right-clicking a web site and
selecting Inspect. Inside the Developer Tools, select the Console tab to
enter and evaluate your JavaScript expressions.
Suppose there is a JavaScript regular expression /re/. This expression
looks for a pattern inside a string, where there is an r character, followed
by an e character. For the sake of simplicity, suppose our strings are case
sensitive.

const s1 = 'Regex';
const s2 = 'regular expression';

In JavaScript, strings have a match method. This method expects a


regular expression and returns some data on the first match.

> s1.match( /re/ )


null

> s2.match( /re/ )


["re", index: 0, input: "regular expression"]

A regular expression is an expression written inside two slash (/)


characters. The expression /re/ searches for an r character followed by
an e character.
As an analogy, imagine that you loaded a web site in the browser,
pressed Ctrl+F or Cmd+F to find a substring inside the web site on the
screen, and started typing re. The regular expression /re/ does the same
thing inside the specified string, except that the results are case sensitive.
Notice that 'Regex' does not contain the substring 're'. Therefore,
there are no matches.

3
Chapter 1 An Introduction to Regular Expressions

The string 'regular expression' contains the substring 're' twice:


once at position 0 and once at position 11. For the sake of determining
the match, the JavaScript regular expression engine returns only the first
match at index 0 and terminates.
JavaScript allows you to turn the syntax around by testing the regular
expression.

> /re/.test( s1 )
false

> /re/.test( s2 )
true

The return value is a simple Boolean. Most of the time, you do not
need anything more, so testing the regular expression is sufficient.
Each programming language has different syntax for built-in regex
support. You can either learn them or generate the corresponding regex
code using an online generator such as https://regex101.com/.1

F rustrations with Regular Expressions Arise


from Lack of Taking Action
According to many software developers, regular expressions are

–– Hard to understand

–– Hard to write

–– Hard to modify

–– Hard to test

–– Hard to debug

1
https://regex101.com/

4
Chapter 1 An Introduction to Regular Expressions

As I mentioned in the introduction of this chapter, lack of


understanding often comes with blame. We tend to blame regular
expressions for these five problems.
To figure out why this blaming exists, let’s discover the journey of a regular
developer, no pun intended, with regexes. Many of us default to this journey
of discovery when it comes to playing around with something we don’t know
well. With regular expressions, the task seems too easy: we just have to create
a short expression, right? Well, oftentimes, this point of view is very wrong.
Trial and error oftentimes takes more time than getting the pain
handled and getting the lack of knowledge cured. Yet, most developers
work with trial and error over and over again. After all, why bother learning
the complex mechanics of regular expressions if you could simply copy
and paste a small snippet? Learning the ins and outs of regular expressions
seems to be too hard at first glance anyway.
Therefore, my mission is to show you that

–– Learning regular expressions is a lot easier than you


thought

–– Knowing regular expressions is fun

–– Knowing regular expressions is beneficial in many


areas of your software developer career
You can still easily master regular expressions to the extent that they
will do exactly what you intended them to do. This mastery comes from
understanding the right theory and getting a lot of practice.

Regular Expressions Are Imperative


Regular expressions are widely misunderstood. Whenever you hear that
regular expressions are declarative, run from that tutorial or blog as far as
you can. Regexes are an imperative language. If you want to understand
regexes as declarative, chances are you will fail.

5
Exploring the Variety of Random
Documents with Different Content
CHAPTER IX.
Stewart—Stewart of Lorn—Appin—Balquhidder—“Donald of the hammer”—
Stewarts of Athole—Grandtully—Balcaskie—Drumin—Ardvoirlich—Steuart of
Dalguise—Ballechin—Fraser—Fraser of Philorth—Lovat—Ballyfurth and Ford—
Beaufort—Castle Fraser—American Frasers—Menzies—Castle Menzies—
Pitfoddels—Chisholm—Cromlix or Cromleck—Murray—Athole—Tullibardine—
Ochtertyre—Drummond—Bellyclone—Græme or Graham—Kincardine—Earl of
Montrose—Gordon—Earl of Huntly—Duke of Gordon—“The Cock of the
North”—Cumming—Ogilvy—Ferguson.

It now only remains for us to notice shortly several of those families,


which, though generally admitted not to be of Celtic origin, yet have
a claim, for various important reasons, to be classed among the
Highland clans. Most of them have been so long established in the
Highlands, they have risen to such power and played such an
important part in Highland history, their followers are so numerous
and so essentially Gaelic in their blood and manners, that any notice
of the Highland clans would be incomplete without an account of
these. We refer to the names of Stewart, Fraser, Menzies, Chisholm,
and several others. To the uninitiated the three last have as genuine
a Gaelic ring about them as any patronymic rejoicing in the
unmistakable prefix “Mac.”
S T E WA RT.
It is not our intention here by any means to enter into the general
history of the Stewarts—which would be quite beyond our province,
even if we had space—but simply to give a short account of those
branches of the family which were located in the Highlands, and to a
certain extent were regarded as Highland clans. With regard to the
origin of the Stewarts generally, we shall content ourselves with
making use of Mr Fraser’s excellent summary in the introduction to
his “Red Book of Grandtully.”
Walter, the son of Alan or Fitz-Alan, the founder of the royal family
of the Stewarts, being the first of that family who established himself
in Scotland, came from Shropshire, in England. Walter’s elder
brother, William, was progenitor of the family of Fitz-Alan, Earls of
Arundel. Their father, a Norman, married, soon after the Norman
Conquest, the daughter of Warine, sheriff of Shropshire. He acquired
the manor of Ostvestrie or Oswestry in Shropshire, on the Welsh
border. On the death of Henry I. of England, in 1135, Walter and
William strenuously supported the claims of the Empress Maud, thus
raising themselves high in the favour of her uncle, David I., king of
the Scots. When that king, in 1141, was obliged to retire to
Scotland, Walter probably then accompanied him, encouraged, on
the part of the Scottish monarch, by the most liberal promises,
which were faithfully fulfilled; whilst his brother William remained in
England, and was rewarded by Maud’s son, Henry II. of England.
From the munificence of King David I. Walter obtained large grants
of land in Renfrewshire and in other places, together with the
hereditary office Senescallus Scociæ, lord high-steward of Scotland,
an office from which his grandson, Walter, took the name of Stewart,
which the family ever afterwards retained. King Malcolm IV.,
continuing, after the example of his grandfather, King David, to
extend the royal favour towards this English emigrant, confirmed
and ratified to Walter and his heirs the hereditary office of high
steward of Scotland, and the numerous lands which King David I.
had granted. In the annals of the period, Walter is celebrated as the
founder, probably about 1163, of the monastery of Paisley, in the
barony of Renfrew. At or after the time of his establishing himself in
Scotland, Walter was followed to that kingdom by many English
families from Shropshire, who, settling in Renfrewshire, obtained
lands there as vassals of the Stewarts. Walter married Eschina de
Londonia, Lady of Moll, in Roxburghshire, by whom he had a son,
Alan; and dying in 1177, he was succeeded in his estates and office
as hereditary steward of Scotland by that son.
Having thus pointed out the true origin of the family of the
Stewarts, our subject does not require us to trace the subsequent
history of the main line.
Walter’s son and successor, Alan, died in 1204, leaving a son,
Walter, who was appointed by Alexander II. justiciary of Scotland, in
addition to his hereditary office of high-steward. He died in 1246,
leaving four sons and three daughters. Walter, the third son, was
Earl of Menteith. The eldest son, Alexander, married Jean, daughter
and heiress of James, lord of Bute, and, in her right, he seized both
the Isle of Bute and that of Arran.
Alexander had two sons—James, his successor, and John, known
as Sir John Stewart of Bonkill, who fell at the battle of Falkirk in
1298. Sir John Stewart had seven sons. 1. Sir Alexander, ancestor of
the Stewarts, Earls of Angus; 2. Sir Alan of Dreghorn, of the Earls
and Dukes of Lennox, of the name of Stewart; 3. Sir Walter, of the
Earls of Galloway; 4. Sir James, of the Earls of Athole, Buchan, and
Traquair, and the Lords of Lorn and Innermeath; 5. Sir John, killed at
Halidonhill in 1333; 6. Sir Hugh, who fought in Ireland under Edward
Bruce; 7. Sir Robert of Daldowie.
James, the elder son of Alexander, succeeded as fifth high-steward
in 1283. On the death of Alexander III. in 1286, he was one of the
six magnates of Scotland chosen to act as regents of the kingdom.
He died in the service of Bruce, in 1309.
His son, Walter, the sixth high-steward, when only twenty-one
years of age, commanded with Douglas the left wing of the Scots
army at the battle of Bannockburn. King Robert bestowed his
daughter, the Princess Marjory, in marriage upon him, and from
them the royal house of Stuart and the present dynasty of Great
Britain are descended.
His son, Robert, seventh lord-high-steward, had been declared
heir presumptive to the throne in 1318, but the birth of a son to
Bruce in 1326 interrupted his prospects for a time. From his
grandfather he received large possessions of land in Kintyre. During
the long and disastrous reign of David II. the steward acted a
patriotic part in the defence of the kingdom. On the death of David,
without issue, February 22d, 1371, the steward, who was at that
time fifty five years of age, succeeded to the crown as Robert II.,
being the first of the family of Stewart who ascended the throne of
Scotland.
The direct male line of the elder branch of the Stewarts
terminated with James V., and at the accession of James VI., whose
descent on his father’s side was through the Earl of Lennox, the
head of the second branch, there did not exist a male offset of the
family which had sprung from an individual later than Robert II.
Widely as some branches of the Stewarts have spread, and
numerous as are the families of this name, there is not a lineal male
representative of any of the crowned heads of the race, Henry,
Cardinal Duke of York,[244] who died in 1807, having been the last.
The crown which came into the Stewart family through a female
seems destined ever to be transmitted through a female.
The male representation or chiefship of the family is claimed by
the Earl of Galloway; also, by the Stewarts of Castlemilk as
descended from a junior branch of Darnley and Lennox.
The first and principal seat of the Stewarts was in Renfrewshire,
but branches of them penetrated into the Western Highlands and
Perthshire, and acquiring territories there, became founders of
distinct families of the name. Of these the principal were the
Stewarts of
LO R N
Lorn, the Stewarts of Athole, and the Stewarts of Balquhidder, from
one or other of which all the rest have been derived. How the
Stewarts of Lorn acquired that district is told in our account of clan
Macdougall. The Stewarts of Lorn were descended from a natural
son of John Stewart, the last Lord of Lorn, who, with the assistance
of the MacLarens, retained forcible possession of part of his father’s
estates. From this family sprang the Stewarts of Appin, in
Argyleshire, who, with the Athole branches, were considered in the
Highlands as forming the clan Stewart. The badge of the original
Stewarts was the oak, and of the royal Stuarts, the thistle.
In the end of the fifteenth century,
the Stewarts of Appin were vassals of
the Earl of Argyll in his lordship of
Lorn. In 1493 the name of the chief
was Dougal Stewart. He was the
natural son of John Stewart, the last
Lord of Lorn, and Isabella, eldest
daughter of the first Earl of Argyll.
The assassination of Campbell of
Calder, guardian of the young Earl of
Argyll, in February 1592, caused a
feud between the Stewarts of Appin
Badge—Oak or Thistle. and the Campbells, the effects of
which were long felt. During the civil
wars, the Stewarts of Appin ranged themselves under the banners of
Montrose, and at the battle of Inverlochy, 2d February 1645,
rendered that chivalrous nobleman good service. They and the cause
which they upheld were opposed by the Campbells, who possessed
the north side of the same parish, a small rivulet, called Con Ruagh,
or red bog, from the rough swamp through which it ran, being the
dividing line of their lands.
The Stewarts of Appin under their chief, Robert Stewart, engaged
in the rebellion of 1715, when they brought 400 men into the field.
They were also “out” in 1745, under Stewart of Ardshiel, 300 strong.
Some lands in Appin were forfeited on the latter occasion, but were
afterwards restored. The principal family is extinct, and their estate
has passed to others, chiefly to a family of the name of Downie.
There are still, however, many branches of this tribe remaining in
Appin. The chief cadets are the families of Ardshiel, Invernahyle,
Auchnacrone, Fasnacloich, and Balachulish.
Between the Stewarts of Invernahyle and the Campbells of
Dunstaffnage there existed a bitter feud, and about the beginning of
the sixteenth century, the former family were all cut off but one
child, the infant son of Stewart of Invernahyle, by the chief of
Dunstaffnage, called Cailein Uaine, “Green Colin.” The boy’s nurse
fled with him to Ardnamurchan, where her husband, the blacksmith
of the district, resided. The latter brought him up to his own trade,
and at sixteen years of age he could wield two forehammers at
once, one in each hand, on the anvil, which acquired for him the
name of Domhnull nan ord, “Donald of the hammers.” Having made
a two-edged sword for him, his foster-father, on presenting it, told
him of his birth and lineage, and of the event which was the cause
of his being brought to Ardnamurchan. Burning with a desire for
vengeance, Donald set off with twelve of his companions, for each
of whom, at a smithy at Corpach in Lochaber, he forged a two-edged
sword. He then proceeded direct to Dunstaffnage, where he slew
Green Colin and fifteen of his retainers. Having recovered his
inheritance, he ever after proved himself “the unconquered foe of
the Campbell.” The chief of the Stewarts of Appin being, at the time,
a minor, Donald of the hammers was appointed tutor of the clan. He
commanded the Stewarts of Appin at the battle of Pinkie in 1547,
and on their return homewards from that disastrous field, in a
famishing condition, they found in a house at the church of Port of
Menteith, some fowls roasting for a marriage party. These they took
from the spit, and greedily devoured. They then proceeded on their
way. The Earl of Menteith, one of the marriage guests, on being
apprised of the circumstance, pursued them, and came up with
them at a place called Tobernareal. To a taunt from one of the earl’s
attendants, one of the Stewarts replied by an arrow through the
heart. In the conflict that ensued, the earl fell by the ponderous arm
of Donald of the hammers, and nearly all his followers were killed.
[245]

The Stewarts of Athole consist almost entirely of the descendants,


by his five illegitimate sons, of Sir Alexander Stewart, Earl of Buchan,
called, from his ferocity, “The wolf of Badenoch,” the fourth son of
Robert II., by his first wife, Elizabeth More. One of his natural sons,
Duncan Stewart, whose disposition was as ferocious as his father’s,
at the head of a vast number of wild Catherans, armed only with the
sword and target, descended from the range of hills which divides
the counties of Aberdeen and Forfar, and began to devastate the
country and murder the inhabitants. Sir Walter Ogilvy, sheriff of
Angus, Sir Patrick Gray, and Sir David Lindsay of Glenesk,
immediately collected a force to repel them, and a desperate conflict
took place at Gasklune, near the water of Isla, in which the former
were overpowered, and most of them slain.
James Stewart, another of the Wolf of Badenoch’s natural sons,
was the ancestor of the family of Stewart of Garth, from which
proceed almost all the other Athole Stewarts. The Garth family
became extinct in the direct line, by the death of General David
Stewart, author of “Sketches of the Highlanders.” The possessions of
the Athole Stewarts lay mainly on the north side of Loch Tay.
The Balquhidder Stewarts derive their origin from illegitimate
branches of the Albany family.
The Stewarts or Steuarts[246] of Grandtully, Perthshire, are
descended from James Stewart of Pierston and Warwickhill, Ayrshire,
who fell at Halidon Hill in 1333, fourth son of Sir John Stewart of
Bonkill, son of Alexander, fourth lord-high-steward of Scotland, who
died in 1283.
James Stewart’s son was Sir Robert Stewart of Shambothy and
Innermeath, whose son, Sir John Stewart, was the first of the
Stewarts of Lorn. The fourth son of the latter, Alexander Stewart,
was ancestor of the Stewarts of Grandtully. “On the resignation of
his father, Sir John (apparently the first Stewart of Grandtully), he
received a charter from Archibald, Earl of Douglas, of the lands of
Grandtully, Kyltilich, and Aberfeldy, 30th March 1414. He married
Margaret, sister of John Hay (?) of Tulliebodie.”[247]
Of this family was Thomas Stewart of Balcaskie, Fifeshire, a lord of
session, created a baronet of Nova Scotia, June 2, 1683. He was
cousin, through his father, of John Stewart, thirteenth of Grandtully,
who died without issue in 1720, and was succeeded by Sir Thomas’s
son, Sir George Stewart, who also died without issue. He was
succeeded by his brother, Sir John Stewart, third baronet, an officer
of rank in the army, who married, 1st, Elizabeth, daughter and
heiress of Sir James Mackenzie of Royston, and had by her an only
surviving son, Sir John, fourth baronet; 2dly, Lady Jane Douglas,
only daughter of James, Marquis of Douglas, and his son, by her,
Archibald Stewart, after a protracted litigation, succeeded to the
immense estates of his uncle, the last Duke of Douglas, and
assuming that name, was created a peer of the United Kingdom, by
the title of Baron Douglas. Sir John Stewart married, 3dly, Helen, a
daughter of the fourth Lord Elibank, without issue. He died in 1764.
His son, Sir John, fourth baronet, died in 1797.
Sir John’s eldest son, Sir George, fifth baronet, married Catherine,
eldest daughter of John Drummond, Esq. of Logie Almond, and died
in 1827, leaving five sons and two daughters.
The eldest son, Sir John, sixth baronet, died without issue, May
20, 1838.
His brother, Sir William Drummond Steuart, born December 26,
1795, succeeded as seventh baronet. He married in 1830, and had a
son William George, captain 93d Highlanders, born in February 1831,
and died October 1868. Sir William died April 28, 1871, and was
succeeded by his youngest brother Archibald Douglas, born August
29, 1807.
The Stewarts of Drumin, Banffshire, now Belladrum, Inverness-
shire, trace their descent from Sir Walter Stewart of Strathaven,
knighted for his services at the battle of Harlaw in 1411, one of the
illegitimate sons of the Wolf of Badenoch, and consequently of royal
blood.
The Stewarts of Ardvoirlich, Perthshire, are descended from James
Stewart, called James the Gross, fourth and only surviving son of
Murdoch, Duke of Albany, Regent of Scotland, beheaded in 1425. On
the ruin of his family he fled to Ireland, where, by a lady of the
name of Macdonald, he had seven sons and one daughter. James II.
created Andrew, the eldest son, Lord Avandale.
James, the third son, ancestor of the Stewarts of Ardvoirlich,
married Annabel, daughter of Buchanan of that ilk.
His son, William Stewart, who succeeded him, married Mariota,
daughter of Sir Colin Campbell of Glenorchy, and had several
children. From one of his younger sons, John, the family of Stewart
of Glenbuckie, and from another, that of Stewart of Gartnaferaran,
both in Perthshire, were descended.
His eldest son, Walter Stewart, succeeded his father, and married
Euphemia, daughter of James Reddoch of Cultobraggan, comptroller
of the household of James IV.
His son, Alexander Stewart of Ardvoirlich, married Margaret,
daughter of Drummond of Drummond Erinoch, and had two sons,
James, his successor, and John, ancestor of the Perthshire families of
Stewart of Annat, Stewart of Ballachallan, and Stewart of Craigtoun.
The family of Steuart of Dalguise, Perthshire, are descended from
Sir John Stewart of Arntullie and Cardneys, also designed of
Dowallie, the youngest natural son of King Robert II. of Scotland, by
Marion or Mariota de Cardney, daughter of John de Cardney of that
ilk, sister of Robert Cardney, bishop of Dunkeld from 1396 to 1436.
The Steuarts of Ballechin, in the same county, are descended from
Sir John Stewart, an illegitimate son of King James II. of Scotland.
Having purchased the lands of Sticks in Glenquaich from Patrick
Cardney of that ilk, he got a charter of those lands from King James
III., dated in December 1486. The family afterwards acquired the
lands of Ballechin.
There are many other Stewart families throughout Scotland, but
as we are concerned only with these which can be considered
Highland, it would be beyond our province to notice any more. The
spelling of this name seems very capricious: the royal spelling is
Stuart, while most families spell it Stewart, and a few Steuart and
Steuard. We have endeavoured always to give the spelling adhered
to by the various families whom we have noticed.
Fraser.
The first of the surname of Fraser in Scotland was undoubtedly of
Norman origin, and, it is not improbable, came over with William the
Conqueror. The Chronicles of the Fraser family ascribe its origin to
one Pierre Fraser, seigneur de Troile, who in the reign of
Charlemagne, came to Scotland with the ambassadors from France
to form a league with King Achaius; but this is, of course, fabulous.
Their account of the creation of their arms is equally incredible.
According to their statement, in the reign of Charles the Simple of
France, Julius de Berry, a nobleman of Bourbon, entertaining that
monarch with a dish of fine strawberries was, for the same,
knighted, the strawberry flowers, fraises, given him for his arms, and
his name changed from de Berry to Fraiseur or Frizelle. They claim
affinity with the family of the Duke de la Frezeliere, in France. The
first of the name in Scotland is understood to have settled there in
the reign of Malcolm Canmore, when surnames first began to be
used, and although the Frasers afterwards became a powerful and
numerous clan in Inverness-shire, their earliest settlements were in
East Lothian and Tweeddale.
FRASER.
In the reign of David I., Sir Simon
Fraser possessed half of the territory
of Keith in East Lothian (from him
called Keith Simon), and to the
monks of Kelso he granted the church
of Keith.
A member of the same family,
Gilbert de Fraser, obtained the lands
of North Hailes, also in East Lothian,
as a vassal of the Earl of March and
Dunbar, and is said to have been
Badge—Yew.
witness to a charter of Cospatrick to
the monks of Coldstream, during the reign of Alexander I. He also
possessed large estates in Tweeddale.
In the reign of Alexander II., the chief of the family was Bernard
de Fraser, supposed to have been the grandson of the above-named
Gilbert, by a third son, whose name is conjectured to have been
Simon. Bernard was a frequent witness to the charters of Alexander
II., and in 1234 was made sheriff of Stirling, an honour long
hereditary in his family. By his talents he raised himself from being
the vassal of a subject to be a tenant in chief to the king. He
acquired the ancient territory of Oliver Castle, which he transmitted
to his posterity. He was succeeded by his son Sir Gilbert Fraser, who
was sheriff or vicecomes of Traquair during the reigns of Alexander
II. and his successor. He had three sons: Simon, his heir; Andrew,
sheriff of Stirling in 1291 and 1293; and William, chancellor of
Scotland from 1274 to 1280, and bishop of St. Andrews from 1279
to his death in 1297.
Sir Simon Fraser, the eldest son,
was a man of great influence and
power. He possessed the lands of
Oliver Castle, Neidpath Castle, and
other lands in Tweeddale; and
accompanied King Alexander II. in a
pilgrimage to Iona, a short time
previous to the death of that
monarch. He was knighted by
Alexander III., who, in the
beginning of his reign, conferred on
him the office of high sheriff of
Tweeddale, which he held from
1263 to 1266. He died in 1291. He
had an only son, Sir Simon Fraser,
the renowned patriot, with whom
Bishop Fraser’s Seal.
may be said (in 1306) to have From Anderson’s Diplomata Scotiæ.
expired the direct male line of the
south country Frasers, after having been the most considerable
family in Peeblesshire during the Scoto-Saxon period of our history,
from 1097 to 1306.
The male representation of the principal family of Fraser devolved,
on the death of the great Sir Simon, on the next collateral heir; his
uncle, Sir Andrew, second son of Sir Gilbert Fraser, above
mentioned. He is supposed to have died about 1308, surviving his
renowned nephew, Sir Simon, only two years. He was, says the
historian of the family,[248] “the first of the name of Fraser who
established an interest for himself and his descendants in the
northern parts of Scotland, and more especially in Inverness-shire,
where they have ever since figured with such renown and
distinction.” He married a wealthy heiress in the county of Caithness,
then and for many centuries thereafter comprehended within the
sheriffdom of Inverness, and in right of his wife he acquired a very
large estate in the north of Scotland. He had four sons, namely—
Simon, the immediate male ancestor of the Lords Lovat, and whose
descendants and dependants (the clan Fraser), after the manner of
the Celts, took the name of MacShimi, or sons of Simon; Sir
Alexander, who obtained the estate of Touch, as the appanage of a
younger son; and Andrew and James, slain with their brother,
Simon, at the disastrous battle of Halidonhill, 22d July 1333.
The ancient family of the Frasers of
Philorth in Aberdeenshire, who have
enjoyed since 1669 the title of Lord
Saltoun, is immediately descended
from William, son of an Alexander
Fraser, who flourished during the
early part of the fourteenth century,
and inherited from his father the
estates of Cowie and Durris in
Kincardineshire.
The proper Highland clan Fraser
was that headed by the Lovat branch
in Inverness-shire, as mentioned
above.
Sir Alexander Fraser of Philorth,
Unlike the Aberdeenshire or Salton
from Pinkerton’s Scotish Gallery.
Frasers, the Lovat branch, the only
branch of the Frasers that became Celtic, founded a tribe or clan,
and all the natives of the purely Gaelic districts of the Aird and
Stratherrick came to be called by their name. The Simpsons, “sons
of Simon,” are also considered to be descended from them, and the
Tweedies of Tweeddale are supposed, on very plausible grounds, to
have been originally Frasers. Logan’s conjecture that the name of
Fraser is a corruption of the Gaelic Friosal, from frith, a forest, and
siol, a race, the th being silent (that is, the race of the forest),
however pleasing to the clan as proving them an indigenous Gaelic
tribe, may only be mentioned here as a mere fancy of his own.
Simon Fraser, the first of the Frasers of Lovat, fell at the battle of
Halidon Hill, 19th July 1333. His son, Hugh Fraser of Lovat, had four
sons; Alexander, who died unmarried; Hugh, created a lord of
Parliament, under the title of Lord Fraser of Lovat; John, ancestor of
the Frasers of Knock in Ayrshire; and another son, ancestor of the
Frasers of Foyers.
Hugh, first Lord Lovat, was one of the hostages for James I., on
his return to Scotland in 1424, and in 1431 he was appointed high
sheriff of the county of Inverness. His son, also named Hugh, second
Lord Lovat, was father of Thomas, third lord; Alexander, ancestor of
the Frasers of Fanaline, the Frasers of Leadclune, baronets, and
other families of the name; and James, ancestor of the Frasers of
Ballyfurth and Ford, of whom Major-General Simon Fraser, late of
Ford, is the lineal male descendant and representative.
Thomas, third lord, held the office of justiciary of the north in the
reign of James IV., and died 21st October 1524. He had four sons:
Thomas, master of Lovat, killed at Flodden, 9th September 1513,
unmarried; Hugh, fourth Lord Lovat; Alexander, fifth lord; and
William Fraser of Struy, ancestor of several families of the name in
Inverness-shire.
Hugh, fourth lord, the queen’s justiciary in the north, resigned his
whole estates into the hands of King James V., and obtained from his
majesty a new charter, dated 26th March 1539, uniting and
incorporating them into the barony of Lovat, to him and the heirs
male of his body, failing whom to his nearest lawful heirs male,
bearing the name and arms of Fraser, and failing them to his heirs
whatsoever. With his eldest son Hugh, Master of Lovat, he was killed
in an engagement with the Macdonalds of Clanranald at Lochlochy,
Inverness-shire, 2d June 1544.[249] His brother, Alexander, fifth Lord
Lovat, died in 1558. With one daughter, the latter had three sons:
Hugh, sixth lord; Thomas, ancestor of the Frasers of Strichen, from
whom Lord Lovat of Lovat is descended; and James of Ardochie.
Hugh, sixth Lord Lovat, had a son, Simon, seventh lord, who was
twice married, and died 3d April 1633. By his first wife, Margaret,
eldest daughter of Sir Colin Mackenzie of Kintail, he had two sons,—
Simon, Master of Lovat, who predeceased him, without issue, and
Hugh, eighth Lord Lovat, who died 16th February 1646. By a second
wife, Jean Stewart, daughter of Lord Doune, he had Sir Simon
Fraser, ancestor of the Frasers of Innerallochy; Sir James Fraser of
Brae, and one daughter. Hugh, eighth lord, had, with three
daughters, three sons, namely,—Simon, Master of Lovat, and Hugh,
who both predeceased their father, the one in 1640 and the other in
1643, and Thomas Fraser of Beaufort, eleventh Lord Lovat. The
second son, Hugh, styled after his elder brother’s death, Master of
Lovat, left a son Hugh, ninth lord, who succeeded his grandfather in
February 1646, and married in July 1659, when a boy of sixteen
years of age at college, Anne, second daughter of Sir John
Mackenzie of Tarbet, baronet, sister of the first Earl of Cromarty, and
by her had a son, Hugh, tenth lord, and three daughters.
Hugh, tenth lord, succeeded his father in 1672, and died in 1696,
when Thomas Fraser of Beaufort, third son of the eighth lord,
became eleventh Lord Lovat, but did not take the title. The tenth
lord married Lady Amelia Murray, only daughter of the first Marquis
of Athole, and had four daughters. His eldest daughter, Amelia,
assumed the title of Baroness Lovat, and married in 1702, Alexander
Mackenzie, younger of Prestonhall, who assumed the name of Fraser
of Fraserdale. His son, Hugh Fraser, on the death of his mother,
adopted the title of Lord Lovat, which, however, by decree of the
Court of Session, 3d July 1730, was declared to belong to Simon,
Lord Fraser of Lovat, as eldest lawful son of Thomas, Lord Fraser of
Lovat, grand-uncle of the tenth lord. This judgment proceeded on
the charter of 1539, and though pronounced by an incompetent
court, was held to be right. To prevent an appeal, a compromise was
made, by which Hugh Mackenzie ceded to Simon, Lord Lovat, for a
valuable consideration, his pretensions to the honours, and his right
to the estates, after his father’s death.
Thomas Fraser of Beaufort, by right eleventh Lord Lovat, died at
Dunvegan in Skye in May 1699. By his first wife, Sibylla, fourth
daughter of John Macleod of Macleod, he had fourteen children, ten
of whom died young. Simon, the eldest surviving son, was the
celebrated Lord Lovat, beheaded in April 1747.
The clan Fraser formed part of the army of the Earl of Seaforth,
when, in the beginning of 1645, that nobleman advanced to oppose
the great Montrose, who designed to seize Inverness, previous to
the battle of Inverlochy, in which the latter defeated the Campbells
under the Marquis of Argyll in February of that year. After the arrival
of King Charles II. in Scotland in 1650, the Frasers, to the amount of
eight hundred men, joined the troops raised to oppose Cromwell,
their chief’s son, the Master of Lovat, being appointed one of the
colonels of foot for Inverness and Ross. In the rebellion of 1715,
under their last famous chief, Simon, Lord Lovat, they did good
service to the government by taking possession of Inverness, which
was then in the hands of the Jacobites. In 1719 also, at the affair of
Glenshiel, in which the Spaniards were defeated on the west coast of
Inverness-shire, the Frasers fought resolutely on the side of
government, and took possession of the castle of Brahan, the seat of
the Earl of Seaforth. On the breaking out of the rebellion of 1745,
they did not at first take any part in the struggle, but after the battle
of Prestonpans, on the 21st September, Lord Lovat “mustered his
clan,” and their first demonstration in favour of the Pretender was to
make a midnight attack on the Castle of Culloden, but found it
garrisoned and prepared for their reception. On the morning of the
battle of Culloden, six hundred of the Frasers, under the command
of the Master of Lovat, a fine young man of nineteen, effected a
junction with the rebel army, and behaved during the action with
characteristic valour.
Lord Lovat’s eldest son, Simon Fraser, Master of Lovat, afterwards
entered the service of government, and rose to the rank of
lieutenant-general in the army.
General Fraser was succeeded by his half-brother, Colonel
Archibald Campbell Fraser of Lovat, appointed consul-general at
Algiers in 1766, and chosen M.P. for Inverness-shire on the general’s
death in 1782. By his wife, Jane, sister of William Fraser, Esq. of
Leadclune, F.R.S., created a baronet, 27th November 1806, he had
five sons, all of whom he survived. On his death, in December 1815,
the male descendants of Hugh, ninth Lord Lovat, became extinct,
and the male representation of the family, as well as the right to its
extensive entailed estates, devolved on the junior descendant of
Alexander, fifth lord, Thomas Alexander Fraser, of Lovat and
Strichen, who claimed the title of Lord Lovat in the peerage of
Scotland, and in 1837 was created a peer of the United Kingdom, by
that of Baron Lovat of Lovat.
The family of Fraser, of Castle Fraser, in Ross-shire, are descended,
on the female side, from the Hon. Sir Simon Fraser, of Inverallochy,
second son of Simon, eighth Lord Lovat, but on the male side their
name is Mackenzie.
American Frasers.
We cannot close our account of the Frasers without briefly
referring to the numerous members of the clan who inhabit British
North America. Concerning these we have been obligingly furnished
with many details by the Honourable John Fraser de Berry, of St
Mark de Cournoyer, Chambly River, Vercheres Cy., District of
Montreal, Member of the Legislative Council for Rougemont. The
information furnished by this gentleman is very interesting, and we
are sorry that the nature of this work, and the space at our disposal,
permits us to give only the briefest summary.
It would seem that in the Dominion of Canada the ancient spirit of
clanship is far from dead; indeed, it appears to be more intensely full
of life there than it is on its native Highland mountains. From
statistics furnished to us by our obliging informant, it would appear
that in British North America there are bearing the old name of
Fraser 12,000 persons, men, women, and children, some speaking
English and some French, many Protestants and many Roman
Catholics, but all, we believe, unflinchingly loyal to the British throne.
Not one of these, according to the Honourable J. Fraser de Berry’s
report, is a day labourer, “earning daily wages,” but all more or less
well-to-do in the world, and filling respectable, and many of them
responsible positions. Many are descendants of the officers and
soldiers of the “Fraser Highlanders,” who settled in British North
America after the American war. “They are all strong well built men,
hardy, industrious, and sober, having fine comfortable houses, where
quietness reigns and plenty abounds.”
Some years ago a movement was formed among these
enthusiastic and loyal Frasers to organise themselves into a branch
clan, to be called the “New Clan Fraser,” partly for the purpose of
reviving and keeping alive the old clan feeling, and partly for
purposes of benevolence. At a meeting held in February 1868, at
Quebec, this movement took definite shape, and “resolutions were
unanimously passed defining the constitution of the clan, pointing
out its object, appointing its dignitaries, determining their duties,
and the time and manner of their election.”
As “Chief of the Frasers of the whole of British North America,”
was elected the Honourable James Fraser de Ferraline, Member of
the Legislative Council for the Province of Nova Scotia, “a wealthy
and influential merchant, born in 1802, on the Drummond estate in
the braes of Stratherrick, Inverness-shire, Scotland; descended by
his father from the Ferraline family of the Frasers, and by his mother
from the Gorthlic Frasers. The true Fraser blood,” we are assured,
“runs very pure through the veins of the worthy chief.”
The great and undoubted success of this laudable movement is,
we believe, mainly owing to the exertions of the Honourable J.
Fraser de Berry, whose enthusiasm and loyalty to his descent and
ancient kinship are worthy of the palmiest days of clanship in the
olden time on its native Highland soil. Besides the “chief” above
mentioned, 111 subordinate chieftains[250] of provinces and districts
have been appointed, and we are sorry that, for the reasons already
mentioned, it is impossible to give a full list of them. We can only
say that the gentleman just mentioned was elected Chieftain of the
Province of Quebec, and also acts as “Secretary to the New Clan
Fraser.” As a specimen of the unflinching thoroughness with which
Mr Fraser de Berry performs his duties, and of the intense
enthusiasm with which he is animated, we may state that he,
founding on documents in his possession, has been able to trace his
genealogy, and, therefore, the genealogy of the whole clan, as far
back as the year 216 A.D.!
Altogether, we cannot but commend the main object of this
organisation of the American Frasers, and think that members of
other clans residing in our colonies would do well to follow their
example. We believe that no member of the Fraser clan in British
North America, who is really anxious to do well, need be in want of
the means of success, for if he only make his position known to the
authorities of the “New Clan,” all needful assistance will be afforded
him. Moreover, we understand, that any one of the name of Fraser,
or allied to the clan, emigrating to the dominion from the old
country, by applying to any member of the Colonial clan, will be put
in the way of obtaining all assistance and information necessary to
his comfortable settlement and success in his new home.
Indeed, this movement of the Frasers has so much to commend it,
that their example has been followed by persons of other names, in
the United States as well as in Canada, and similar clan
confederations are in the way of being formed under names that are
certainly not Highland.
M E N Z I E S.
From the armorial bearings of the Menzieses it has been
conjectured that the first who settled in Scotland of this surname
was a branch of the Anglo-Norman family of Meyners, by corruption
Manners. But this supposition does not seem to be well-founded.
The family of Menzies obtained
a footing in Athole at a very early
period, as appears from a charter
granted by Robert de Meyners in
the reign of Alexander II. This
Robert de Meyners, knight, on the
accession of Alexander III. (1249)
was appointed lord high
chamberlain of Scotland. His son,
Alexander de Meyners, possessed
the lands of Weem and Aberfeldy
in Athole, and Glendochart in
Badge—Heath
Breadalbane, besides his original (a species named the Menzies heath).
seat of Durrisdeer in Nithsdale,
and was succeeded by his eldest son, Robert, in the estates of
Weem, Aberfeldy, and Durrisdeer, whilst his second son, Thomas,
obtained the lands of Fortingal.
From the former of these is descended the family of Menzies of
Castle Menzies, but that of Menzies of Fortingal terminated in an
heiress, by whose marriage with James Stewart, a natural son of the
Wolf of Badenoch, the property was transferred to the Stewarts.
MENZIES.
In 1487, Sir Robert de Mengues, knight, obtained from the crown,
in consequence of the destruction of his mansion-house by fire, a
grant of the whole lands and estates erected into a free barony,
under the title of the barony of Menzies. From this Sir Robert lineally
descended Sir Alexander Menzies of Castle Menzies, who was
created a baronet of Nova Scotia, 2d September 1665.
Sir Robert Menzies, the seventh baronet, who succeeded his
father, 20th August 1844, is the 27th of the family in regular
descent. The ancient designation of the family was Menzies of
Weem, their common style in old writings. In 1423 “David Menzies of
Weem (de Wimo)” was appointed governor of Orkney and Shetland,
“under the most clement lord and lady, Eric and Philippa, king and
queen of Denmark, Swedland, and Norway.”
The Gaelic appellation of the clan is Meinnarich, a term, by way of
distinction, also applied to the chief. Of the eighteen clans who
fought under Robert Bruce at Bannockburn, the Menzies was one.
The “Menyesses” of Athole and Appin Dull are named in the
parliamentary rolls of 1587, as among “the clans that have captains,
chiefs, and chieftains.” Castle Menzies, the principal modern seat of
the chief, stands to the east of Loch Tay, in the parish and near to
the church of Weem, in Perthshire. Weem Castle, the old mansion, is
picturesquely situated under a rock, called Craig Uamh, hence its
name. In 1502, it was burnt by Niel Stewart of Fortingal, in
consequence of a dispute respecting the lands of Rannoch.
In 1644, when the Marquis of Montrose appeared in arms for
Charles I., and had commenced his march from Athole towards
Strathern, he sent forward a trumpeter, with a friendly notice to the
Menzieses, that it was his intention to pass through their country. His
messenger, unhappily, was maltreated, and, as some writers say,
slain by them. They also harassed the rear of his army, which so
exasperated Montrose, that he ordered his men to plunder and lay
waste their lands and burn their houses.
During the rebellion of 1715, several gentlemen of the clan
Menzies were taken prisoners at the battle of Dunblane. One of
them, Menzies of Culdares, having been pardoned for his share in
the rebellion, felt himself bound not to join in that of 1745. He sent,
however, a valuable horse as a present to Prince Charles, but his
servant who had it in charge, was seized and executed, nobly
refusing to divulge his master’s name, though offered his life if he
would do so. In the latter rebellion, Menzies of Shian took out the
clan, and held the rank of colonel, though the chief remained at
home. The effective force of the clan in 1745 was 300.
The family of Menzies of Pitfoddels in Aberdeenshire, is now
extinct. Gilbert Menzies of this family, carrying the royal standard at
the last battle of Montrose, in 1650, repeatedly refused quarter, and
fell rather than give up his charge. The last laird, John Menzies of
Pitfoddels, never married, and devoted the greater part of his large
estate to the endowment of a Roman Catholic College. He died in
1843.
CHISHOLM.
The modern clan Chisholm or Siosal,
in Inverness-shire, though claiming to
be of Celtic origin, are, it is probable,
descended from one of the northern
collaterals of the original family of
Chisholme of Chisholme in
Roxburghshire, which possessed
lands there as early as the reign of
Alexander III.
Few families have asserted their
right to be considered as a Gaelic
Badge—Fern.
clan with greater vehemence than the
Chisholms, notwithstanding that there are perhaps few whose
Lowland origin is less doubtful. Their early charters suffice to
establish the real origin of the family with great clearness. The
Highland possessions of the family consist of Comer, Strathglass, &c.,
in which is situated their castle of Erchless, and the manner in which
they acquired these lands is proved by the fact, that there exists a
confirmation of an indenture betwixt William de Fenton of Baky on
the one part, and “Margaret de la Ard domina de Erchless and
Thomas de Chishelme her son and heir” on the other part, dividing

You might also like