Characters Types and Meta-Characters
In this lesson, we'll learn about the characters that are the basic building blocks of all regular expressions. You will also learn about meta-characters, which are the characters with special meanings.
Characters types
Characters are the most fundamental building blocks in regular expressions.
Below are some common types of characters:
- Letters or alphabets -
A
,B
,C
, … - Digits -
0
,1
,2
,3
, … - Punctuations -
!
,.
,?
,,
,;
, … - Other symbols -
#
,$
,@
, … - Unicode characters representing international text
In Java, characters are encoded using Unicode standard, which is designed so that the first eight bits match the ASCII encoding.
Run the Java program to print all the ASCII characters (extended set of 256 characters):
Press + to interact
public class Main{public static void main(String[] args){System.out.println("<h3>ASCII characters</h3>");for(int i = 0; i <= 255; i++){System.out.print("\t&#" + i + ";");}}}
0 - 31 are ASCII control characters designed to control hardware devices.
Control characters are non-printable, except for horizontal tabulation (\t
), line ...