Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

nested-reference

How does this regex find triangular numbers?

June 9, 2023 by Tarik

Explanation Here’s a schematic breakdown of the pattern: from beginning… | …to end | | ^(\1.|^.)+$ \______/|___match group 1 one-or-more times The (…) brackets define capturing group 1, and this group is matched repeatedly with +. This subpattern is anchored with ^ and $ to see if it can match the entire string. Group 1 … Read more

Categories c# Tags c++, capturing-group, java, nested-reference, regex Leave a comment

How can we match a^n b^n?

December 31, 2022 by Tarik

The answer is, needless to say, YES! You can most certainly write a Java regex pattern to match anbn. It uses a positive lookahead for assertion, and one nested reference for “counting”. Rather than immediately giving out the pattern, this answer will guide readers through the process of deriving it. Various hints are given as … Read more

Categories regex Tags capturing-group, nested-reference, regex, regex-lookarounds Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa