SlideShare a Scribd company logo
2
Most read
© 2017 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 3 www.netacad.com
Laboratorio 27.2.9
Nombre: Rafael Buenaño Semestre: 9no B
Lab - Regular Expression Tutorial
Objectives
In this lab, you will learn how to use regular expressions to search for desired strings of information.
Part 1: Compete the regexone.com tutorial.
Part 2: Describe the provided regular expression pattern.
Part 3: Verify your answers.
Background / Scenario
A regular expression (regex) is a pattern of symbols that describes data to be matched in a query or other
operation. Regular expressions are constructed similarly to arithmetic expressions, by using various operators
to combine smaller expressions. There are two major standards of regular expression, POSIX and Perl.
In this lab, you will use an online tutorial to explore regular expressions. You will also describe the information
that matches given regular expressions.
Required Resources
• CyberOps Workstation virtual machine
• Internet connection
Instructions
Part 1: Complete the regexone.com tutorial.
a. Open a web browser and navigate to https://regexone.com/ from your host computer. Regex One is a
tutorial that provides you with lessons to learn about regular expression patterns.
b. After you have finished with the tutorial, record the function of some of the metacharacters that are used
in regular expressions.
Metacharacters Description
$ bla Coincide con la posición final dentro de la cadenank
* Coincide con cero o más veces para el elemento anterior
. Coincide con cero o más veces para el elemento anterior
[ ] cualquier carácter en la lista
. Periodo
Lab - Regular Expression Tutorial
© 2017 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 3 www.netacad.com
Metacharacters Description
d Cualquier carácter de dígito
D Cualquier carácter que no sea un dígito
^ Coincide con la posición inicial dentro de la cuerda
{m} coincide con m número de repeticiones
{n,m} al menos n número de repeticiones, pero no más de m veces
abc|123
Coincide con cualquier cadena que coincida con cualquiera
de las expresiones: 123, abc
Part 2: Describe the provided regular expression pattern.
Regex pattern Description
^83 Cualquier cadena que comience con el número 83
[A-Z]{2,4}
Cualquier cadena que contenga de 2 a 4 letras mayúsculas
consecutivamente
2015 Cualquier cadena que contenga 2015
05:22:2[0-9] Cualquier cadena que contenga de 05:22:20 a 05:22:29
.com Cualquier cadena que contenga .com
complete|GET Cualquier cadena que coincida con complete o GET
0{4} Cualquier cadena que contenga 4 ceros consecutivamente
Part 3: Verify your answers.
In this step, you will verify your answers in the previous step using a text file stored in the CyberOps
Workstation VM.
a. Launch and log in to the CyberOps Workstation VM (username: analyst / password: cyberops).
b. Open a terminal and navigate to the following folder:
[analyst@secOps ~]$ cd lab.support.files/
c. Use the less command to open the logstash-tutorial.log file.
[analyst@secOps lab.support.files]$ less logstash-tutorial.log
Lab - Regular Expression Tutorial
© 2017 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 3 www.netacad.com
d. At the bottom of the screen, you will see logstash-tutorial.log: highlighted. This is the cursor at which
you will enter the regular expression. Precede the regular expression with a forward slash (/). For
example, the first pattern in the above table is ^83. Enter /^83.
The matching text from the log file is highlighted. Use the scroll wheel on the mouse or use the j or k keys
on your keyboard to locate the highlighted patterns.
e. For the next expression, enter /[A-Z]{2,4} at the colon (:) prompt.
Note: The colon is replaced by / as you type the expression.
f. Enter the rest of the regular expressions from the table in Step 2. Make sure all the expressions are
preceded with a forward slash (/). Continue until you have verified your answers. Press q to exit the
logstash-tutorial.log file.
g. Close the terminal and shut down the VM.
End of document

More Related Content

What's hot (8)

PPTX
regex.pptx
qnuslv
 
PDF
7 conexion de fuente de energia
RUBEN PERALTA GUIZADA
 
PDF
UVM TUTORIAL;
Azad Mishra
 
PPTX
Introduction to System verilog
Pushpa Yakkala
 
PPTX
Regular Expression
Mahzad Zahedi
 
PDF
Namespaces
Sangeetha S
 
PPT
Crash course in verilog
Pantech ProLabs India Pvt Ltd
 
PPTX
Python Programming Essentials - M24 - math module
P3 InfoTech Solutions Pvt. Ltd.
 
regex.pptx
qnuslv
 
7 conexion de fuente de energia
RUBEN PERALTA GUIZADA
 
UVM TUTORIAL;
Azad Mishra
 
Introduction to System verilog
Pushpa Yakkala
 
Regular Expression
Mahzad Zahedi
 
Namespaces
Sangeetha S
 
Crash course in verilog
Pantech ProLabs India Pvt Ltd
 
Python Programming Essentials - M24 - math module
P3 InfoTech Solutions Pvt. Ltd.
 

Similar to 27.2.9 lab regular expression tutorial (20)

PPTX
Regular expression examples
NetProtocol Xpert
 
PDF
Basta mastering regex power
Max Kleiner
 
PPTX
Bioinformatics p2-p3-perl-regexes v2014
Prof. Wim Van Criekinge
 
PPTX
Chapter 3: Introduction to Regular Expression
azzamhadeel89
 
PPT
Bioinformatica 06-10-2011-p2 introduction
Prof. Wim Van Criekinge
 
PPTX
Bioinformatica p2-p3-introduction
Prof. Wim Van Criekinge
 
PDF
Regexp
Bhorotsana RK
 
PDF
Course 102: Lecture 13: Regular Expressions
Ahmed El-Arabawy
 
PPT
Regular Expressions grep and egrep
Tri Truong
 
PPTX
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
Prof. Wim Van Criekinge
 
PDF
Regex - Regular Expression Basics
Eterna Han Tsai
 
PPTX
Finaal application on regular expression
Gagan019
 
PDF
Maxbox starter20
Max Kleiner
 
PPTX
Regular expressions
Eran Zimbler
 
PDF
Python - Lecture 7
Ravi Kiran Khareedi
 
PPT
2.regular expressions
Praveen Gorantla
 
PDF
Tutorial on Regular Expression in Perl (perldoc Perlretut)
FrescatiStory
 
PPT
Perl Intro 5 Regex Matches And Substitutions
Shaun Griffith
 
PPT
Perl Presentation
Sopan Shewale
 
ODP
OISF: Regular Expressions (Regex) Overview
ThreatReel Podcast
 
Regular expression examples
NetProtocol Xpert
 
Basta mastering regex power
Max Kleiner
 
Bioinformatics p2-p3-perl-regexes v2014
Prof. Wim Van Criekinge
 
Chapter 3: Introduction to Regular Expression
azzamhadeel89
 
Bioinformatica 06-10-2011-p2 introduction
Prof. Wim Van Criekinge
 
Bioinformatica p2-p3-introduction
Prof. Wim Van Criekinge
 
Course 102: Lecture 13: Regular Expressions
Ahmed El-Arabawy
 
Regular Expressions grep and egrep
Tri Truong
 
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
Prof. Wim Van Criekinge
 
Regex - Regular Expression Basics
Eterna Han Tsai
 
Finaal application on regular expression
Gagan019
 
Maxbox starter20
Max Kleiner
 
Regular expressions
Eran Zimbler
 
Python - Lecture 7
Ravi Kiran Khareedi
 
2.regular expressions
Praveen Gorantla
 
Tutorial on Regular Expression in Perl (perldoc Perlretut)
FrescatiStory
 
Perl Intro 5 Regex Matches And Substitutions
Shaun Griffith
 
Perl Presentation
Sopan Shewale
 
OISF: Regular Expressions (Regex) Overview
ThreatReel Podcast
 
Ad

More from Freddy Buenaño (8)

PDF
27.2.15 lab investigating a malware exploit
Freddy Buenaño
 
PDF
27.2.14 lab isolate compromised host using 5-tuple
Freddy Buenaño
 
PDF
27.2.12 lab interpret http and dns data to isolate threat actor
Freddy Buenaño
 
PDF
27.2.10 lab extract an executable from a pcap
Freddy Buenaño
 
PDF
27.1.5 lab convert data into a universal format
Freddy Buenaño
 
PDF
26.1.7 lab snort and firewall rules
Freddy Buenaño
 
PDF
25.3.11 packet tracer logging from multiple sources
Freddy Buenaño
 
PDF
25.3.10 packet tracer explore a net flow implementation
Freddy Buenaño
 
27.2.15 lab investigating a malware exploit
Freddy Buenaño
 
27.2.14 lab isolate compromised host using 5-tuple
Freddy Buenaño
 
27.2.12 lab interpret http and dns data to isolate threat actor
Freddy Buenaño
 
27.2.10 lab extract an executable from a pcap
Freddy Buenaño
 
27.1.5 lab convert data into a universal format
Freddy Buenaño
 
26.1.7 lab snort and firewall rules
Freddy Buenaño
 
25.3.11 packet tracer logging from multiple sources
Freddy Buenaño
 
25.3.10 packet tracer explore a net flow implementation
Freddy Buenaño
 
Ad

Recently uploaded (20)

PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PPT
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PPTX
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PDF
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
Day2 B2 Best.pptx
helenjenefa1
 
PPTX
Snet+Pro+Service+Software_SNET+Pro+2+Instructions.pptx
jenilsatikuvar1
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Thermal runway and thermal stability.pptx
godow93766
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Day2 B2 Best.pptx
helenjenefa1
 
Snet+Pro+Service+Software_SNET+Pro+2+Instructions.pptx
jenilsatikuvar1
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
monopile foundation seminar topic for civil engineering students
Ahina5
 

27.2.9 lab regular expression tutorial

  • 1. © 2017 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 3 www.netacad.com Laboratorio 27.2.9 Nombre: Rafael Buenaño Semestre: 9no B Lab - Regular Expression Tutorial Objectives In this lab, you will learn how to use regular expressions to search for desired strings of information. Part 1: Compete the regexone.com tutorial. Part 2: Describe the provided regular expression pattern. Part 3: Verify your answers. Background / Scenario A regular expression (regex) is a pattern of symbols that describes data to be matched in a query or other operation. Regular expressions are constructed similarly to arithmetic expressions, by using various operators to combine smaller expressions. There are two major standards of regular expression, POSIX and Perl. In this lab, you will use an online tutorial to explore regular expressions. You will also describe the information that matches given regular expressions. Required Resources • CyberOps Workstation virtual machine • Internet connection Instructions Part 1: Complete the regexone.com tutorial. a. Open a web browser and navigate to https://regexone.com/ from your host computer. Regex One is a tutorial that provides you with lessons to learn about regular expression patterns. b. After you have finished with the tutorial, record the function of some of the metacharacters that are used in regular expressions. Metacharacters Description $ bla Coincide con la posición final dentro de la cadenank * Coincide con cero o más veces para el elemento anterior . Coincide con cero o más veces para el elemento anterior [ ] cualquier carácter en la lista . Periodo
  • 2. Lab - Regular Expression Tutorial © 2017 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 3 www.netacad.com Metacharacters Description d Cualquier carácter de dígito D Cualquier carácter que no sea un dígito ^ Coincide con la posición inicial dentro de la cuerda {m} coincide con m número de repeticiones {n,m} al menos n número de repeticiones, pero no más de m veces abc|123 Coincide con cualquier cadena que coincida con cualquiera de las expresiones: 123, abc Part 2: Describe the provided regular expression pattern. Regex pattern Description ^83 Cualquier cadena que comience con el número 83 [A-Z]{2,4} Cualquier cadena que contenga de 2 a 4 letras mayúsculas consecutivamente 2015 Cualquier cadena que contenga 2015 05:22:2[0-9] Cualquier cadena que contenga de 05:22:20 a 05:22:29 .com Cualquier cadena que contenga .com complete|GET Cualquier cadena que coincida con complete o GET 0{4} Cualquier cadena que contenga 4 ceros consecutivamente Part 3: Verify your answers. In this step, you will verify your answers in the previous step using a text file stored in the CyberOps Workstation VM. a. Launch and log in to the CyberOps Workstation VM (username: analyst / password: cyberops). b. Open a terminal and navigate to the following folder: [analyst@secOps ~]$ cd lab.support.files/ c. Use the less command to open the logstash-tutorial.log file. [analyst@secOps lab.support.files]$ less logstash-tutorial.log
  • 3. Lab - Regular Expression Tutorial © 2017 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 3 www.netacad.com d. At the bottom of the screen, you will see logstash-tutorial.log: highlighted. This is the cursor at which you will enter the regular expression. Precede the regular expression with a forward slash (/). For example, the first pattern in the above table is ^83. Enter /^83. The matching text from the log file is highlighted. Use the scroll wheel on the mouse or use the j or k keys on your keyboard to locate the highlighted patterns. e. For the next expression, enter /[A-Z]{2,4} at the colon (:) prompt. Note: The colon is replaced by / as you type the expression. f. Enter the rest of the regular expressions from the table in Step 2. Make sure all the expressions are preceded with a forward slash (/). Continue until you have verified your answers. Press q to exit the logstash-tutorial.log file. g. Close the terminal and shut down the VM. End of document