SlideShare a Scribd company logo
Regular Expressions in Java
Regular Expressions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Perl and Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A first example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Doing it in Perl and Ruby ,[object Object],[object Object],[object Object],[object Object],[object Object]
Doing it in Java, I ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Doing it in Java, II ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Finding what was matched ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A complete example import java.util.regex.*;   public class RegexTest {   public static void main(String args[]) {   String pattern = "[a-z]+";   String text = "Now is the time";   Pattern p = Pattern.compile(pattern);   Matcher m = p.matcher(text);   while (m.find()) {   System.out.print(text.substring ( m.start(), m.end() )  + "*");   }   } } Output:  ow*is*the*time*
Additional methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some simple patterns ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sequences and alternatives ,[object Object],[object Object],[object Object],[object Object]
Some predefined character classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Notice the space. Spaces are  significant in regular expressions!
Boundary matchers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Greedy quantifiers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Types of quantifiers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Quantifier examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Capturing groups ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Capturing groups in Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example use of capturing groups ,[object Object],[object Object],[object Object],[object Object]
Double backslashes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Escaping metacharacters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spaces ,[object Object],[object Object],[object Object],[object Object]
Additions to the  String  class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thinking in regular expressions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The End “ A little learning is a dangerous thing;   drink deep, or taste not the Pierian spring:   there shallow draughts intoxicate the brain,   and drinking largely sobers us again.”   --Alexander Pope

More Related Content

What's hot

Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaj Gupta
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Ignaz Wanders
 
Python advanced 2. regular expression in python
Python advanced 2. regular expression in pythonPython advanced 2. regular expression in python
Python advanced 2. regular expression in pythonJohn(Qiang) Zhang
 
Andrei's Regex Clinic
Andrei's Regex ClinicAndrei's Regex Clinic
Andrei's Regex Clinic
Andrei Zmievski
 
Python (regular expression)
Python (regular expression)Python (regular expression)
Python (regular expression)
Chirag Shetty
 
Finaal application on regular expression
Finaal application on regular expressionFinaal application on regular expression
Finaal application on regular expression
Gagan019
 
Regex Presentation
Regex PresentationRegex Presentation
Regex Presentationarnolambert
 
Regular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimRegular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to Vim
Stalin Thangaraj
 
Textpad and Regular Expressions
Textpad and Regular ExpressionsTextpad and Regular Expressions
Textpad and Regular Expressions
OCSI
 
Regular expression
Regular expressionRegular expression
Regular expression
Larry Nung
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
Ben Brumfield
 
Regular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsRegular Expression (Regex) Fundamentals
Regular Expression (Regex) Fundamentals
Mesut Günes
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
Danny Bryant
 
Regular expression
Regular expressionRegular expression
Regular expression
Rajon
 
Strings in Python
Strings in PythonStrings in Python
Strings in Python
nitamhaske
 
Python strings
Python stringsPython strings
Python strings
Mohammed Sikander
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
Amrit Kaur
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Eran Zimbler
 
Regular Expressions grep and egrep
Regular Expressions grep and egrepRegular Expressions grep and egrep
Regular Expressions grep and egrepTri Truong
 
Regular expression examples
Regular expression examplesRegular expression examples
Regular expression examples
NetProtocol Xpert
 

What's hot (20)

Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Python advanced 2. regular expression in python
Python advanced 2. regular expression in pythonPython advanced 2. regular expression in python
Python advanced 2. regular expression in python
 
Andrei's Regex Clinic
Andrei's Regex ClinicAndrei's Regex Clinic
Andrei's Regex Clinic
 
Python (regular expression)
Python (regular expression)Python (regular expression)
Python (regular expression)
 
Finaal application on regular expression
Finaal application on regular expressionFinaal application on regular expression
Finaal application on regular expression
 
Regex Presentation
Regex PresentationRegex Presentation
Regex Presentation
 
Regular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimRegular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to Vim
 
Textpad and Regular Expressions
Textpad and Regular ExpressionsTextpad and Regular Expressions
Textpad and Regular Expressions
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
 
Regular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsRegular Expression (Regex) Fundamentals
Regular Expression (Regex) Fundamentals
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Strings in Python
Strings in PythonStrings in Python
Strings in Python
 
Python strings
Python stringsPython strings
Python strings
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Regular Expressions grep and egrep
Regular Expressions grep and egrepRegular Expressions grep and egrep
Regular Expressions grep and egrep
 
Regular expression examples
Regular expression examplesRegular expression examples
Regular expression examples
 

Viewers also liked

enums
enumsenums
enums
teach4uin
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
Krasimir Berov (Красимир Беров)
 
Expresiones regulares
Expresiones regularesExpresiones regulares
Expresiones regulares
Jordan-P
 
Graph theory 1
Graph theory 1Graph theory 1
Graph theory 1Tech_MX
 

Viewers also liked (7)

enums
enumsenums
enums
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
 
Regexp master 2011
Regexp master 2011Regexp master 2011
Regexp master 2011
 
Expresiones regulares
Expresiones regularesExpresiones regulares
Expresiones regulares
 
Java GC
Java GCJava GC
Java GC
 
Graph theory 1
Graph theory 1Graph theory 1
Graph theory 1
 
Java I/O
Java I/OJava I/O
Java I/O
 

Similar to 16 Java Regex

Regular_Expressions.pptx
Regular_Expressions.pptxRegular_Expressions.pptx
Regular_Expressions.pptx
DurgaNayak4
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20
Max Kleiner
 
Java căn bản - Chapter9
Java căn bản - Chapter9Java căn bản - Chapter9
Java căn bản - Chapter9Vince Vo
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and Strings
Eduardo Bergavera
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
regular-expression.pdf
regular-expression.pdfregular-expression.pdf
regular-expression.pdf
DarellMuchoko
 
Regex lecture
Regex lectureRegex lecture
Regex lecture
Jun Shimizu
 
Unit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressionsUnit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressions
sana mateen
 
Strings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perlStrings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perl
sana mateen
 
unit-4 regular expression.pptx
unit-4 regular expression.pptxunit-4 regular expression.pptx
unit-4 regular expression.pptx
PadreBhoj
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
SanthiyaAK
 
Regex startup
Regex startupRegex startup
Regex startup
PayPal
 
PERL Regular Expression
PERL Regular ExpressionPERL Regular Expression
PERL Regular ExpressionBinsent Ribera
 
Lecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfLecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdf
Saravana Kumar
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
Prof. Wim Van Criekinge
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
Logan Palanisamy
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressions
Krishna Nanda
 
Python - Lecture 7
Python - Lecture 7Python - Lecture 7
Python - Lecture 7
Ravi Kiran Khareedi
 

Similar to 16 Java Regex (20)

M C6java7
M C6java7M C6java7
M C6java7
 
Regular_Expressions.pptx
Regular_Expressions.pptxRegular_Expressions.pptx
Regular_Expressions.pptx
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20
 
Java căn bản - Chapter9
Java căn bản - Chapter9Java căn bản - Chapter9
Java căn bản - Chapter9
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and Strings
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
regular-expression.pdf
regular-expression.pdfregular-expression.pdf
regular-expression.pdf
 
Regex lecture
Regex lectureRegex lecture
Regex lecture
 
Unit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressionsUnit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressions
 
Strings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perlStrings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perl
 
unit-4 regular expression.pptx
unit-4 regular expression.pptxunit-4 regular expression.pptx
unit-4 regular expression.pptx
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
 
Regex startup
Regex startupRegex startup
Regex startup
 
PERL Regular Expression
PERL Regular ExpressionPERL Regular Expression
PERL Regular Expression
 
Lecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfLecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdf
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressions
 
Python - Lecture 7
Python - Lecture 7Python - Lecture 7
Python - Lecture 7
 
Les08
Les08Les08
Les08
 

More from wayn

Orissa Riots
Orissa RiotsOrissa Riots
Orissa Riotswayn
 
Global Warmin Powerpoint
Global Warmin PowerpointGlobal Warmin Powerpoint
Global Warmin Powerpointwayn
 
European Exploration And Colonization
European Exploration And ColonizationEuropean Exploration And Colonization
European Exploration And Colonizationwayn
 
. Elsecretoparaserfeliz
. Elsecretoparaserfeliz. Elsecretoparaserfeliz
. Elsecretoparaserfelizwayn
 
Jesus Loves You
Jesus Loves YouJesus Loves You
Jesus Loves Youwayn
 
Congestive Heart Failure
Congestive Heart FailureCongestive Heart Failure
Congestive Heart Failurewayn
 
Koah Patogenezi
Koah PatogeneziKoah Patogenezi
Koah Patogeneziwayn
 
Paseo Nocturno Night City Tour Of The World
Paseo Nocturno   Night City Tour Of The WorldPaseo Nocturno   Night City Tour Of The World
Paseo Nocturno Night City Tour Of The Worldwayn
 
A Better Way
A Better WayA Better Way
A Better Waywayn
 
Here Comes The Winter
Here Comes The WinterHere Comes The Winter
Here Comes The Winterwayn
 
Fun On The Net
Fun On The NetFun On The Net
Fun On The Netwayn
 
Alluring Asia
Alluring AsiaAlluring Asia
Alluring Asiawayn
 
A Better Way
A Better WayA Better Way
A Better Waywayn
 
Back To School Presentation
Back To School PresentationBack To School Presentation
Back To School Presentationwayn
 
Happy new year2008
Happy new year2008Happy new year2008
Happy new year2008wayn
 
Words.....
Words.....Words.....
Words.....wayn
 
Referee Image Slide
Referee Image SlideReferee Image Slide
Referee Image Slidewayn
 
Why I Got Fired
Why I Got Fired Why I Got Fired
Why I Got Fired wayn
 
New Year 1
New Year 1 New Year 1
New Year 1 wayn
 
Bluetooth Presentation
Bluetooth PresentationBluetooth Presentation
Bluetooth Presentationwayn
 

More from wayn (20)

Orissa Riots
Orissa RiotsOrissa Riots
Orissa Riots
 
Global Warmin Powerpoint
Global Warmin PowerpointGlobal Warmin Powerpoint
Global Warmin Powerpoint
 
European Exploration And Colonization
European Exploration And ColonizationEuropean Exploration And Colonization
European Exploration And Colonization
 
. Elsecretoparaserfeliz
. Elsecretoparaserfeliz. Elsecretoparaserfeliz
. Elsecretoparaserfeliz
 
Jesus Loves You
Jesus Loves YouJesus Loves You
Jesus Loves You
 
Congestive Heart Failure
Congestive Heart FailureCongestive Heart Failure
Congestive Heart Failure
 
Koah Patogenezi
Koah PatogeneziKoah Patogenezi
Koah Patogenezi
 
Paseo Nocturno Night City Tour Of The World
Paseo Nocturno   Night City Tour Of The WorldPaseo Nocturno   Night City Tour Of The World
Paseo Nocturno Night City Tour Of The World
 
A Better Way
A Better WayA Better Way
A Better Way
 
Here Comes The Winter
Here Comes The WinterHere Comes The Winter
Here Comes The Winter
 
Fun On The Net
Fun On The NetFun On The Net
Fun On The Net
 
Alluring Asia
Alluring AsiaAlluring Asia
Alluring Asia
 
A Better Way
A Better WayA Better Way
A Better Way
 
Back To School Presentation
Back To School PresentationBack To School Presentation
Back To School Presentation
 
Happy new year2008
Happy new year2008Happy new year2008
Happy new year2008
 
Words.....
Words.....Words.....
Words.....
 
Referee Image Slide
Referee Image SlideReferee Image Slide
Referee Image Slide
 
Why I Got Fired
Why I Got Fired Why I Got Fired
Why I Got Fired
 
New Year 1
New Year 1 New Year 1
New Year 1
 
Bluetooth Presentation
Bluetooth PresentationBluetooth Presentation
Bluetooth Presentation
 

Recently uploaded

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

16 Java Regex

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. A complete example import java.util.regex.*; public class RegexTest { public static void main(String args[]) { String pattern = "[a-z]+"; String text = "Now is the time"; Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(text); while (m.find()) { System.out.print(text.substring ( m.start(), m.end() ) + "*"); } } } Output: ow*is*the*time*
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. The End “ A little learning is a dangerous thing; drink deep, or taste not the Pierian spring: there shallow draughts intoxicate the brain, and drinking largely sobers us again.” --Alexander Pope