html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!-- @Dan&Jel -->
<!DOCTYPE html>
<html>
<head>
<title> Java Regular Expressions</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-light.min.css">
</head>
<body>
<pre>
(java regex!:) Tutorial with examples <b>Part 2</b>
<h2> Java Regular Expressions</h2>
Now we are familiar with Pattern and Matcher
class and the process of matching a regular
expression against the text. Lets see what
kind of various options we have to define a
regular expression:
<h3> #1 String Literals</h3>
Lets say you just want to search a particular
String in the text for e.g. "abc" then we can
simply write the code like this: Here text and
regex both are same.
<code>Pattern.matches("abc", "abc")
</code>
<h3> #2 Character Classes</h3>
A character class matches a single character
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
//by @boolean maybe
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run