Extract Nginx Logs by Date Range Using sed

When nginx access logs reach gigabyte scale, utilities like cat or tail become impractical for pinpointing traffic on a specific date. The sed stream editor processes text line-by-line using regular expressions, making it efficient for slicing large log files by timestamp ranges. Log Timestamp Structure A standard nginx access entry places the ...

Posted on Tue, 21 Jul 2026 17:08:10 +0000 by SUNNY ARSLAN

Java File Pattern Matching Techniques

Implementing File Pattern Matching in Java When working with file systems in Java applications, developers often need to find files that match specific patterns. This article demonstrates how to implement file pattern matching using Java's built-in libraries. Implementation Steps The following table outlines the key steps involved in implementi ...

Posted on Tue, 14 Jul 2026 17:05:11 +0000 by Xu Wei Jie

Commonly Used Regular Expression Patterns

<h2>1. Number Validation Patterns</h2> <pre> 1. Any number: ^\d*$ 2. Exactly n digits: ^\d{n}$ (\d is equivalent to [0-9]) 3. At least n digits: ^\d{n,}$ 4. m to n digits: ^\d{m,n}$ 5. Zero or a number without leading zeros: ^(0|[1-9]\d*)$ 6. Non-zero with up to two decimal places: ^([1-9]\d*)+(\.\d{1,2})?$ 7. Positive or nega ...

Posted on Tue, 07 Jul 2026 16:20:56 +0000 by mamoman

Modifying Query Parameters with INFINI Gateway: Regex-Based Approach

This article explores how to use INFINI Gateway's regex replacement capabilities to fix problematic query parameters. The techniques discussed here also apply to Opensaerch and Easysearch environments. In a previous article, we covered the request_body_json_set processor for modifying query parameters. This piece will focus on the request_body_ ...

Posted on Mon, 29 Jun 2026 16:20:59 +0000 by Katanius

Multithreaded C Implementation with Regex and File I/O for Extracting Numeric Data

This article demonstrates a C program that reads a source file line by line, extracts numeric segments from each line using regular expressions, and writes the results to a target file. The implementation uses two threads that alternate execution, with a mutex protecting shared data. The gather thread is responsible for reading lines from the s ...

Posted on Tue, 26 May 2026 18:04:04 +0000 by ionik

Advanced String Replacement Patterns in JavaScript

The replace() method on JavaScript strings appears straightforward at first glance, but its true capabilities emerge when combined with regular expressions. While simple substring replacement works for basic scenarios, regex integration unlocks sophisticated text transformation patterns essential for modern development. Syntax and Return Behavi ...

Posted on Tue, 19 May 2026 07:44:54 +0000 by dkruythoff

Understanding Java's String Class and Regular Expressions

The String Constant Pool Java's String Constant Pool is a specialized memory area designed to store string literals, optimizing memory usage and performance. Its location has evolved across Java versions. Key Characteristics of the String Pool Storage Location: In Java 6 and earlier, the pool resided in the PermGen (Permanent Generation). Star ...

Posted on Sun, 17 May 2026 05:04:04 +0000 by travelbuff

Advanced Web Scraping Techniques for Rankings, Products, and Images

Extracting Structured Ranking Data Utilizing requests alongside BeautifulSoup enables efficient extraction of tabular data from static web pages. The following implementation targets university ranking lists, parsing specific DOM elements to compile rank, institution name, location, type, and score. import requests from bs4 import BeautifulSoup ...

Posted on Sat, 16 May 2026 07:09:57 +0000 by sarathi

Handling Regular Expressions and Tabular Data in Python

Using the re Module for Pattern Matching Regular expressions (regex) are sequences of characters defining a search pattern, commonly used for string validation and parsing. Python's re module provides full support for these patterns. Matching from the Start: re.match The match function attempts to match a pattern only at the beginning of a stri ...

Posted on Sun, 10 May 2026 07:32:09 +0000 by balloontrader

Understanding the String.split Method in Java

The split method in Java is commonly used to divide strings based on a delimiter. The single-parameter version: public String[] split(String regex) { return split(regex, 0); } invokes an overloaded method with a default limit of 0. The underlying implementation: public String[] split(String regex, int limit) { String[] fast = Pattern.f ...

Posted on Sat, 09 May 2026 00:42:34 +0000 by ketola