SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

REGEX / NOTES</>↗
Regex31 Oct 2010

How do I write character class subtraction regex?

You can use subtraction to negate one or more nested character classes. This example creates a single character class that matches everything from a to z, except the vowels (‘a’, ‘i’, ‘u’, ‘e’, ‘o’). This can be written in a subtraction pattern as [a-z&&[^aiueo]]. package org.kodejava.regex; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CharacterClassSubtractionDemo { public […]

Wayan · 2 min read
REGEX / NOTES</>↗
Regex30 Oct 2010

How do I write simple character class regex?

A character class in the context of regular expression is a set of characters enclosed within a square brackets "[]". It specifies the characters that will successfully match a single character from the given input. A simple class, the most basic form of character class, is formed simply by placing a set of characters side-by-side […]

Wayan · 2 min read
REGEX / NOTES</>↗
Regex30 Oct 2010

How do I write negated character class regex?

A negation class is a character class that begins with a ^ metacharacter which will exclude a set of defined characters within a square brackets. For example the negation class h[^ao]t in the example below match only the word hit and exclude the words hat and hot. package org.kodejava.regex; import java.util.regex.Matcher; import java.util.regex.Pattern; public class […]

Wayan · 1 min read
REGEX / NOTES</>↗
Regex30 Oct 2010

How do I write range character class regex?

To define a character class that includes a range of values, put – metacharacter between the first and last character to be matched. For example [a-e]. You can also specify multiple ranges like this [a-zA-Z]. This will match any letter of the alphabet from a to z (lowercase) or A to Z (uppercase). In the […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing27 Oct 2010

How do I set and get the contents of JTextArea?

To set and get the contents of a JTextArea you can use the setText(String text) and getText() methods. In the code below we create a JTextArea and sets its contents after we create a new instance of JTextArea. To get the contents we use the action on a button. When the button is pressed the […]

Wayan · 2 min read
SWING / NOTES</>↗
Swing27 Oct 2010

How do I set the tab size in JTextArea?

In this example you will be shown how to set or change the tab size for the JTextArea component. You can use the setTabSize(int size) to define the tab size. For this demo we create a combo box that have some integer values which will be used to define the tab size. When you change […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.