Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

REGEX / CATATAN</>
Regex05 Nov 2010

How do I count the number of capturing groups?

Capturing groups are numbered by counting the opening parentheses from left to right. To find out how many groups are present in the expression, call the groupCount() method on a matcher object. The groupCount() method returns an int showing the number of capturing groups present in the matcher’s pattern. package org.kodejava.example.regex; import java.util.regex.Matcher; import java.util.regex.Pattern; […]

Wayan · 2 menit baca
REGEX / CATATAN</>
Regex05 Nov 2010

How do I compile character classes with quantifier?

This example show you how to attach quantifier to character classes or capturing group in regular expressions. package org.kodejava.example.regex; import java.util.regex.Pattern; import java.util.regex.Matcher; public class CombineWithQuantifier { public static void main(String[] args) { // [abc]{3} –> apply quantifier in character class. // Find 'a' or 'b' or 'c', three times in a row. // // […]

Wayan · 2 menit baca
REGEX / CATATAN</>
Regex05 Nov 2010

How do I use reluctant quantifier regex?

The reluctant quantifiers start the matcher at the beginning of the input string, then reluctantly eat one character at a time looking for a match. The last thing they try is the entire input string. package org.kodejava.regex; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ReluctantQuantifierDemo { public static void main(String[] args) { String[] expressions = {"x??", […]

Wayan · 2 menit baca
REGEX / CATATAN</>
Regex05 Nov 2010

How do I use possessive quantifier regex?

The possessive quantifiers always eat the entire input string, trying once (and only once) for a match. Unlike the greedy quantifiers, possessive quantifiers never back off, even if doing so would allow the overall match to succeed. package org.kodejava.regex; import java.util.regex.Matcher; import java.util.regex.Pattern; public class PossessiveQuantifierDemo { public static void main(String[] args) { String[] regexs […]

Wayan · 2 menit baca
REGEX / CATATAN</>
Regex05 Nov 2010

How do I write embedded flag expression?

It’s also possible to enable various flags using embedded flag expressions. Embedded flag expressions are an alternative to the two-argument version of compile, and are specified in the regular expression itself. The example below is use (?i) flag expression to enable case-insensitive matching. Another flag expressions are listed below: (?x), equivalent with Pattern.COMMENTS (?m), equivalent […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API05 Nov 2010

How do I pause the current thread?

You can pause a current thread for a number of milliseconds by using the sleep() method of the Thread class. While the current thread is sleeping, it will allow other threads to execute. package org.kodejava.lang; public class ThreadSleepDemo implements Runnable { public static void main(String[] args) { Thread thread = new Thread(new ThreadSleepDemo()); thread.start(); } […]

Wayan · 1 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.