►
From YouTube: More Powerful Find-and-Replace in the GitLab Handbook
Description
Derek shares with Monica a high-level overview of what regular expressions are and why they are useful. This chat is geared for those less familiar with programming.
B
Sure
so,
and
if
and
if,
depending
how
successful
this
goes,
I
can
we
may
just
end
this
and
then
I'll
record
it
once
I'm
actually
kind
of
in
the
groove
or
something.
But
I
think
at
a
high
level,
we
should
be
able
to
solve
this
so
just
to
take
a
step
back.
B
The
goal
of
this
is
to
basically
do
a
find
and
replace
in
a
more
efficient
manner,
as
opposed
to
manually,
going
through
all
the
links
and
selecting
them
and
replacing
them
with
the
corresponding
new
destination
link
is
that
is
that
your
expectation.
B
Okay,
cool
so
yeah,
just
again,
the
small
amount
of
background
of
initially
chatting
with
you
monica
I'm
obviously
talking
to
whoever's
gonna,
be
watching
this.
I
guess
well,
which
is
kind
of
weird,
but
it
is
what
it
is.
So
basically
what
came
to
mind
almost
instantly
when
you
initially
shared
this,
I
think
in
slack
was
basically
we
can
use
regular
expressions,
which
is
basically
a
it's
very
cryptic,
which
is
the
lame
part
to
learn
it,
but
it's
really
powerful.
B
B
Create
a
a
essentially
a
pattern
that
you
want
to
find
within
a
huge
amount
of
text
or
a
small
amount
of
text.
That's
why
it's
powerful
too
right
as
you
can
iterate
over
tons
of
files.
It
can
be
used
over
your
entire
operating
system
in
some
cases.
B
So,
for
example,
a
really
good
use
case
would
be
say
you
have
a
this
one
might
connect
so
say.
For
example,
you
have
a
digital
camera
and
you
and
you
you
know,
store
the
folder
on
your
computer
or
something
people
might
not
do
this
anymore.
But
this
is
an
example.
B
Maybe
everyone
uses
the
cloud
now,
but
you
could
technically
do
this
on
the
cloud
too,
like
it
could
do
the
same
thing.
You
can
basically
say
every
single
image
that
starts
with
ing
underscore.
You
know
those
there's,
these
common
patterns
file
names
just
get.
You
could
replace
that
and
also
automatically
kind
of
do
a
batch
renaming
where
you
could
say,
remove
the
image
dash
underscore
and
just
call
it
one
and
then
two
and
three
and
four.
So
you
can
replace
every
single
one
which
again
might
not
be
a
big
deal.
B
If
you
only
have
ten
images,
but
if
you
had
hundreds
or
thousands
or
you
know,
I'm
sure
that's
basically
where
the
power
is
okay.
So
what
we'll
do
here
is,
I
don't
know?
If
we'll,
I
could
have
prepped
a
little
bit
better
to
be
honest,
but
we
can
give
it
a
whirl.
So
basically,
what
we'll
try
to
do
is-
and
this
might
be,
what
is
it
called
regex
or
yeah
sweet?
So
there
are.
B
This
is
a
a
website
and
there
are
other
ones
like
this
that
allow
you
to
kind
of
in
real
time
test
this.
So
it's
a
lot
quicker
which,
as
you
might
expect,
when
you
get
quick
feedback,
that's
where
the
winds
are
so
sure
so
up
here
we
have
what's
known
as
the
regular
expression
excuse
me
and
down
here.
We
just
have
some
body
of
text
okay.
B
B
Okay,
so
that's
just
an
interesting
bonus
to
be
honest,
so
we
can
at
least
focus
our
efforts
here.
Naturally,
you
could
expect
if
you,
if
your
pattern,
if
your
regular
expression
wasn't
good
enough
or
it
wasn't
tight
enough,
you
could
act
and
you
ran
it
over
a
bunch
of
directories
and
not
just
one
file.
You
could
obviously
the
with
with
great
power,
comes
great
responsibility
right.
You
could
actually
do
that
this
find
and
replace
on
more
than
you'd
expect.
B
So
that's
something
you
got
to
be
kind
of
careful
about,
but
since
this
is
in
one
file,
that's
actually
even
better
what
I'm
gonna
do
and
if
you
have
any
questions,
feel
free
to.
A
B
B
You
wouldn't
want
to
do
this
if
there
was
sensitive
information
here
on
a
public
site
like
this,
it's
just
something
to
be
aware
of,
and
since
this
is
just
a
public
set
of
con
like,
for
example,
if
you
had
passwords
here,
this
site
might
actually
record
what
people
look
at
or
like
what
people
paste
in
here
just
so
it
can
learn.
C
B
A
Can
see
right
now,
good
question,
sorry,
just
not
to
interrupt
you
but
quick
question
so
since
so
the
use
case
for
this
definitely
is
like
getting
them
replaced
from
this
page,
but
it's
also
like
looking
through
the
handbook
to
see
like
where
are
those
old
links
linked,
if
that
makes
sense
like
where
are
they
hyperlinked
and
then
replacing
them
with
that?
Okay,
I
just
wanted
to
make
sure
I
I
didn't
know
if
I
was
like.
B
Wait
so
let
me
confirm
what
you
just
said.
So
are
you
saying
we're
not
just
we're
replacing
all
these
links
in
just
this
file
with
the
sorry
with
the
corresponding
replacing
link
over
here,
but
you
also
want
to
make
sure
that
any
of
these
links
on
the
left
side
in
the
current
anchored
link
that
are
referenced
anywhere
in
the
handbook
also
want
to
be
replaced.
A
B
A
And
sorry,
if
I
wasn't
clear
on
that,
yes,
so
that's
and
that's
the
main
use
case
really
is
like
because
it
makes
sense
the
most
of
those
links
on
that
handbook
page
are
actually
going
away,
like
a
lot
of
that
copy
is
just
there
right
now
as
a
band-aid,
because
there
wasn't
there
wasn't
like
any
kind
of
redirect
or
find
or
replace,
and
so
the
main
thing
is
like
yes,
once
all
of
these
links
are
replaced
everywhere
with
the
new
link
where
it
should
be,
then
you
know,
then
we
can
just
go
ahead
and
delete
all
that
copy
on
the
homepage.
A
C
B
No,
it
didn't
it's
just
going
to
take
a
little
bit
more
time.
Basically
to
what
I
just
said
a
few
minutes
ago,
like
great
power,
comes
great
responsibility.
We
just
want
to
I'm
going
to
need
a
little
bit
more
time.
Just
to
com,
you
know
be
sure,
is
basically
okay,
so
we
can
still
finish
this
recording
no
problem.
We
still
have
20
minutes
and
I
can
at
least
convey
the
general
idea
about
it,
and
then
you
can
just
imagine
now
we
do
this.
B
C
B
Directories
and
then
for
each
directory.
If
there's
a
particular
file
that
has
a
md
markdown
extension,
we
could
only
target
those
and
we
could
run
the
same
regular
expression
over
all
the
files.
So
that's
what
I'll
basically
end
up
doing,
but
we
can
just
focus
on
this
one
for
now.
Okay,
so,
as
you
can
see,
it's
already
matching
some
things.
So
basically,
what
and
again
this
is
where
it's
really
cryptic-
and
I
don't
this
took
me
a
long
time
to
like
every
time.
A
B
Then
it'd
be
a
pain
in
the
butt
and
then
it's
like,
but
it's
powerful,
I'm
gonna
dabble
in
it.
Oh,
but
it's
so
cryptic.
So
it's
like
it's
a
hard
thing
to
get
past
and
there
might
even
be
it'd,
be
I'll.
Just
I'll
just
stay
there
yeah,
basically
it's
kind
of
cryptic,
but
again
it's
really
powerful.
B
So
what
it's
doing
right
here
is-
and
I
don't
expect
you
or
anyone
else
to
remember
this
because
again
it
does
take
time,
but
I
can
share
a
link
with
you
that
basically
defines
what
all
these
patterns
are
and
then
you
can
kind
of
like
if
you
wanted
for
yourself
to
like
play
with
it
to
experiment.
That
would
be
again.
C
B
B
You
could
also
do
pcre,
apparently,
which
I'm
not
familiar
with
in
different
programming
languages,
sometimes
have
this.
I
have
to
use
a
little
bit
different
characters,
but
the
same
concepts.
C
B
The
same,
and
I
believe
that
would
only
be
because
that
language
had
already
predetermined
one
of
those
characters
to
mean
something
special
in
its
language
got
it.
That
makes
sense,
that's
an
ideal
world.
It
would
be
the
same
everywhere,
but
that's
probably
one
reason
why
that
might
not
happen.
Okay,
that
makes
sense.
But
anyway,
what
this
is
doing
is
saying-
and
you
can
see
the
little
hover
which
gives
you,
which
is
awesome
too,
so
a
to
z,
any
characters
between
a
to
z,
followed
by.
B
A
word
character,
matches
any
word
character
and
then
one
or
more
of
the
preceding
token.
So
it's
basically,
I
think
it's
finding
a
capital,
it's
finding
the
capital
letter,
the
capital,
a
through
z,
so
there's
no
capital
in
any
of
these
there's
no
capital.
Here,
oh,
we
found
a
capital
letter.
So
that's
where
at
least
this
is
has
potential,
then,
after
that
we're
looking
for
any
word
character,
which
is
just
slash
w
again.
This
is
very
cryptic,
but
that
matches
to
any
alphanumer
alphabetical
character.
I
think
numerical
oh
yeah.
B
B
B
Where
we
have
this
capital,
then
we
say
followed
by
some
kind
of
word
character,
which
again
is
alphanumeric
or
underscore
one
or
more
times,
and
it
happened
one
two
three
four
times,
but
then
it
knows
how
to
it
knows
to
automatically
stop,
because
it
ran
into
a
new
character.
That
we
didn't
say
is
what
we
want.
A
B
And
then,
and
then
these
little
parentheses
say
it's
called
the
capturing
group,
and
what
this
basically
says
is
capture
this
for
later,
because
I'm
going
to
use
it
later,
if
you
didn't
care
about
that-
and
you
were
just
going
to
like
typically
what
you
do
is
pretty
much.
What
we're
going
to
be
doing
is
typically,
you
want
to
find
patterns
and
replace
certain
portions
of
that
string
with
something
else
specific
that
you
know
you
want
to
switch
it
with.
So
that's
where
caption
groups
are
really
helpful.
B
So,
for
example,
we
have
this
caption
group
of
just
the
s.
Maybe
you
wanted
to
say
so.
Here's
kind
of
a
funny
example
that
I
think
facebook
actually
did
a
while
ago
for
like
pirate
day
or
something
is
basically
on
your
page.
You
could
pirate
piratify
it
or
something
and
all
it
did
was.
Basically,
you
can
almost
do
this
without
a
regular
expression,
probably
but
yes,
but
basically
it
found
every
r
or
maybe
it
wouldn't
probably
found
every
word
that
ends
with
r
now
turn
that
r
into
three
r's.
B
A
B
B
C
B
Special
special
character,
so
there's
another
pattern
you
have
to
add
to
escape
it,
which
means
I
really
mean
this
character:
don't
use
it
as
a
special
regular
expression,
meaning
use
it
as
the
literal
meaning.
I
want.
B
Yeah
so
again,
this
is
really
cryptic
and
we
have
no
matches.
B
And
so
I
so
these
would
all
be
kind
of
the
beginning
of
absolute
urls,
whereas
I
think
a
lot
in
a
lot
of
these
cases.
We
might
actually
just
have
relative
urls.
I
don't
know
like
if
it's
just
the
anchor
and
not
proceeding
about
doggylive.com.
B
So
that's
where
I
was
saying
like
we'd,
it's
going
to
take
me
a
little
bit
more
time
to
basically
do
this
right,
but
but
at
a
high
level,
that's
basically
what
it's
doing
is
saying
what
we're
going
to
end
up
doing
is
saying
I'm
going
to
create
a
regular
expression
where
it
has
so.
Another
thing
you
can
do
is
in
regular
expressions.
You
can
do
optional,
so
it's
like
it
is
there
or
it's
not.
So
what
we're
going
to?
B
What
I'm
going
to
do
is
say
if
it's
https
all
the
way
through
sales,
but
it's
optional.
It
might
also
just
be
followed
by
the
pound,
sign,
okay
and
then,
after
that,
I'm
gonna
have
basically
a
list
of
this
is
my
expectations.
I
could
be
wrong,
but
I'm
pretty
confident
this
is
gonna
work,
it's
basically
gonna,
say
https
all
the
way
up
to
sales,
but
it's
optional.
B
It
may
not
be
there
and
that's
okay
as
long
as
it's
still
followed
by
the
pound
sign,
and
then
it's
followed
by
one
of
these
literal
values
which
are
going
to
be
each
of
the
actual
links.
So
we'd
have
one
two
three
four
five,
six
of
those
and
then
we'll
be
comma
separated,
and
then
that
will
be
the
end
of
the
of
the
regular
expression
that
I
want
to
create
and
then
again
I'd
make
sure.
B
That's
you
know
I'm
getting
next
the
results,
I'm
basically
wanting
in
a
tool
like
this
before
I
really
run
it
and
then,
when
I
have
that
in
code,
I
can
actually
do
a
replace
of
all
those
instances
of
these
seven
instances.
Six
instances
with.
C
B
Basically,
what's
gonna,
it's
gonna
end
up
happening,
and
I
haven't
actually
done
this
in
in
vs
code,
which
is
the
tool
I
was
initially
gonna.
Think
of
doing,
I
don't
know
if
it's
gonna
have
like
string
limits
on
this
or
not,
but
if
it
doesn't,
then
I'm
just
gonna
have
to
do
this
on
the
command
line
or
something
I
have
to
figure
out
exactly
how
I'm
gonna
do
it,
but.
C
B
Exactly
so
that's
so
I
remember
I
had
the
note
of
create
one,
mr,
so
I
think
I
have
I
I
think
again.
I
took
this
note
a
month
ago.
I
guess
I
think
that
was
your
preference.
We
probably
want
to
break
them
up
into
smaller,
mrs
just
for
the
sake
of
review,
because,
as
you
can
imagine,
if
that's
something
I
got
to
think
about
a
little
bit,
is
we
want?
B
It
needs
to
be
in
smaller
chunks
so
that
you
can
easily
review
them,
because
if
again,
if
you
just
do
a
mask,
find
and
replace
we're
going
to
have
a
merge
request,
that
has
potentially
touched
hundreds
of
files
and
that's
like
extremely
difficult
to
know.
If
there
was
an
error
in
some
place
or
not
sure
sure.
A
No,
that
makes
sense,
and-
and
just
I
mean
I
don't
know
for
sure,
but
my
hunch
is
that
there's.
I
don't
think
that
these
are
interlinked
an
insane
amount.
There
might
be
a
couple
that
are,
but
most
of
these
yeah
I
mean
I
definitely
agree.
The
1mr
thing
was
just
like
more
of
a
note
to
like
you
know
it
doesn't
have
to
be
separated
in
any
particular
way.
So,
whatever
you
think
is
like
easiest
on
the
on
the
organization
side,.
B
Cool
so
so
I
guess
we
can
just
we
still
have
nine
minutes,
so
we
can
give
this
a
whirl.
A
C
B
So
this
is,
this
is
kind
of
if
I
was
a
regular
expression
guru.
This
would
go
a
lot
faster,
but
this
is
kind
of
the
idea
we'll
try
this
again.
I
I
mean
I
don't
even
know
if
this
is
important
for
you
now,
but.
B
So
I
think
colin
might
have
a
special
character,
so
we
have
no
matches.
We
saw
earlier
that
if
we
remove
this,
we
do
get
15
matches.
So,
let's
just
scroll
until
we
get
one
just
to
see.
So
we
have
youtube.
B
So
that's
the
thing
I
think
a
lot
of
them
are
going
to
be
relative,
which
again
you're
familiar
with
that
right.
B
B
I
would
if
I
were
to
guess
I
would
have
to.
B
Guess
it
was
kind
of
originated
out
of
a
developer
time
kind
of
optimization
or
or
like
usefulness.
I.
B
That's
actually
a
very
good
question,
so
the
absolute
url
will
always
work
assuming
the
server
actually
like
has
the
requested
file
at
that
location.
Then
you're
then
you're
good
to
go
so
it
might
be
weird.
Then
why
would
you
ever
not
always
have
the
absolute
and
again
that's
a
great
question.
This
answer
could
be
wrong,
but
my
guess
is
like
in
so
this
is
actually
a
good
example
so
for
in
like,
like,
we
even
have
it
right,
we
have,
we
actually
have.
B
I
think
we
have
review
apps
that
are
on
gitlab.io,
slash
blah
blah
blah
if
they
were
all
absolute,
which
actually
happens
in
some
cases
like
if
like,
if
you
were
on,
if
I
were
to
be
running
the
handbook
locally,
which
I
do
during
development.
Sometimes
if
the
link,
for
example,
this
youtube
link,
it
would
always
point
to
that
exact
location,
whereas
if
you
did
the
relative
url,
it
would
be
relative
to
this
file
currently,
where
I'm
being
hosted.
So
if
I'm
on
gitlab.com,
it
would
point
to
that
file.
B
A
B
B
A
A
A
B
B
C
B
That
gets
that
gets
a
little
scary,
but
that
could
be
a
potential
regular
expression
use
case.
Basically,
it's
to
do
a
mass
replacement
of.
We
don't
want
to
do
absolutely
anymore.
We
know
everywhere
where
we
have
https
gitlab.com
blah
blah
blah,
and
we
want
it
just
to
always
be
relative.
Then
you
can
remove
just
that
first
portion
of
the
url,
for
example,
across
all
the
files.
So
that's
just
another
example.
I
guess.
B
But
we
have
about
four
minutes
and
yeah,
like
I
said
I
think
I'm
gonna
have
to
refresh
on
this.
I
didn't
really
prepare
as
well.
I'm
actually
a
little
confused.
Why.
B
So
that
works
yeah,
I
don't
know,
I'd-
have
to
look
at
it
again,
but
basically
that
is
like
I
said
conceptually
was
what's
gonna
happen.
I'm
gonna
ensure
that
we
have
so
these
are
all
sales.
So
for
this
page
maybe
I'll
do
one,
mr
for
just
this
page
or
something
I'll
have
to
look
into
how,
as
you
say,
you
feel
like
there's
not
going
to
be
a
lot
of
instances
where
the
slash
sales
is
referenced
from
other
files.
B
I
can
do
a
quick
test
locally
to
kind
of
confirm
or
deny
that,
and
if
that's
the
case
that
can
inform
how
many
mrs
might
be
a
good
idea
or
not
yeah.
So
it's
not
a
crazy
burden
during
the
review
process.
A
No,
that
makes
sense,
yeah
and,
like
I
said,
whatever
is
easy
like
one
one
is
fine,
it's
one
per
page
like
is
fine
too,
like
whatever,
whatever
makes
the
most
sense,
and
of
course
just
just
let
me
know,
for
some
reason
it
you
know
it
becomes
unattainable
or
it's
just
like
too
much,
and
we
can
figure
out
something
else.
But
I
really,
I
really
appreciate
you
helping
automate
this
a
little
bit
or
at
least
make
it
more
automated,
because
this
would
have
been
crazy
to
try
to
do.
B
That's
kind
of,
like
I
said,
that's
kind
of
stuck
out.
It
seemed
very,
very
possible,
so
all
yeah,
I
probably
what
the
30th
is.
That
right
is
that
the
due
date.
A
Yeah
this
was
we're
working
in
like
a
a
couple
sprints.
It's
not
we're
not
like
married
to
that.
So
if
it's
not
possible
this
week,
don't
worry
about
it.
Just
in
the
next
like
week
or
two
would
be,
would
be
nice
and
then
I'm
gonna
just
go
through.
Like
I
said
once
it's
done,
then
I
can
go
through
and
delete
all
of
that
old
content
and
we
can
finally
kind
of
finalize
that
new
home
homepage
format.
So
just
let
me
know
what's
realistic
but
yeah.
A
B
C
B
It
should
go
quickly.
I
like
I
said
I
just
have
to
refresh
a
little
bit
so
basically
again
just
regexer.com
if
you're
curious
to
like
maybe
just
explore
other
little
patterns,
because
again
it's
very
useful
to
do
this
and
there
might
be
other
tools
that
make
it
even
easier.
So
you
don't
have
to
learn
the
cryptic
part
I'd.
Imagine
that
would
exist
right,
there's
trade-offs,
obviously
there
and
that
you
might
not
get
as
granular
as
you
might
want,
or
something.
C
A
B
Exactly
so,
that's
why
the
difference
would
be
I'm
going
to
do
this
locally
on
my
machine,
because
I
actually
have
the
capacity
to
run
over
the
files
right
and
do
a
replace
so
got
it,
and
I
was
just
in
just
for
sheer
transparency
of
how
I
was
going
to
try
to
do.
It
was
just
and
I
can
share
real
quick.
I
think
I
shared
this
last
time
too.
B
So
if
I
did
a
find
in
folder
over
app
we'll
pretend
like
this
is
the
source
handbook
just
pretended?
That's
that's
what
this
directory
is
in
here.
I
can
do
a
find
and
replace
so
right
now,
I'm
looking
for
this
is
just
from
some
work.
B
I
was
doing
previously
this
particular
exact
literal
string,
but
I
could
obviously
do
basically
you
can
do
a
regular
expression
instead
by
clicking
this
button
right
here,
use
regular
expression
and
then
it's
basically
doing
exactly
what
I
did
over
in
the
other
area,
but
it
allows
me
to
replace
it.
So
this
is
what
I
was
planning
to
do
at
least
from
a
first
test,
just
because
it'd
be
really
quick.
B
Exactly
so
yeah,
it's
basically
the
replace,
say
we
wanted
to
we're
refactoring
in
this
thing
called
description,
template
and
now
it's
like
new
template
odds,
I'll
see
a
terrible
name.
Well,
you
get
the
idea,
and
now
it
would
say
it
would
replace
this
with
that
and
that's
again
kind
of
yeah
anyway
code
editors
have
different
kind
of
tools
like
this
to
help.
You
do
this
in
a
better
way
than
this
also,
but
this
obviously
has
a
a
great
use
when
you,
when
you
want
to
replace
certain
unique
patterns
nice
so.