Skip to content
Alessandro Lacava
  • Home
  • Blog
  • Articles
  • Talks

Tag 3 posts

RegExp

Writing about RegExp.

JavaScript26 Nov 2007

Capturing groups using regular expressions (RegEx) in JavaScript

There are whole books about regular expressions, so this post isn't intended to be an exhaustive resource on the subject. It simply shows how to extract a substring from a string using…

Read article ↗
Java10 Oct 2006

How to select any character across multiple lines in Java

You can do that using the following pattern in the static compile method of the java.util.regex.Pattern class. The pattern is (.|n|r)? which means: any character (the .) or (the |) n or r.…

Read article ↗
Java12 Jul 2006

How to force one or more metacharacters to be treated as ordinary characters in a Java Regular Expression (RegEx)

When using RegEx in Java you might need to treat one or more metacharacters as ordinary characters. As a reminder, the metacharacters in a Java RegEx are: ([{^$|)?+. If you want to treat…

Read article ↗
Alessandro Lacava

Software, words, and the ideas in between.

GitHub ↗LinkedIn ↗X / Twitter ↗Email ↗
© 2026 Alessandro Lacava
RSS feedPrivacy and cookies