What does the Text Extractor do?
The Text Extractor isolates, matches, and extracts specific substrings and tokens from unformatted text, multiline logs, code files, and documents using a side-by-side dual-pane workspace. It supports extraction between start/end delimiters, custom regular expressions, column splitters, or built-in presets (Emails, URLs, IPv4 addresses, Numbers, and HTML tags).
Core Concepts
Understanding text extraction strategies:
- Delimiter-Based Extraction: Extracts substrings bounded by specified start and end markers (e.g. text between
[and], or between quotes). - Regular Expression Capture: Employs ECMAScript regular expressions to extract specific capture groups or entire regex matches.
- Built-in Presets: Pre-compiled regex patterns to extract common developer entities like RFC 5322 email addresses, HTTP(S) URLs, IPv4 addresses, and numbers.
- Column / Field Splitting: Extracts a specific 1-indexed field across multiline tabular logs or CSV/TSV data separated by custom delimiters.
- Deduplication & Formatting: Automatically removes duplicate matches and formats results as single-column lines, comma-separated lists, or JSON arrays.
How to use the tool?
- Enter or Upload Source Text: Type or paste text into the left editor, upload a local file, or click Sample.
- Configure Extraction Rules: Select an extraction mode (Delimiters, Regex, Presets, or Columns), set boundary characters or patterns, and select output formatting.
- Inspect Extracted Items: Click Extract Text to view matched items in the right editor.
- Copy or Export: Click Copy to copy the extracted results to your clipboard or Download to save as
.txtor.json.
Context-Aware Practical Workflow Guides
Extracting Log Timestamps & IDs
- Set Start Delimiter to
[and End Delimiter to]to extract all bracketed timestamps, severity levels, and thread names from server log streams.
Scraping URLs & Email Addresses
- Select Common Pattern Presets and choose URLs and Links or Email Addresses to aggregate contact information or API endpoints from raw text files.
Related Developer Utilities
- Text Diff Tool: Compare two text documents side-by-side with line and character diff highlighting.
- Prompt Variable Extractor: Detect and extract template placeholders (
{{var}},${var},<var>) with JSON Schema synthesis. - Text Sorter: Sort text lists, logs, and strings alphabetically or numerically.
- Regex Generator: Build and test regular expression patterns interactively.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/text/extractor) for programmatic text extraction.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | The source text to extract from. | "[INFO] User logged in: alice" |
mode |
String | Extraction mode: "delimiters", "regex", "preset", or "column". |
"delimiters" |
startDelimiter |
String | Starting delimiter character or string. | "[" |
endDelimiter |
String | Ending delimiter character or string. | "]" |
includeDelimiters |
Boolean | Whether to retain delimiters in output (default: false). |
false |
outputFormat |
String | Format: "lines", "comma", or "json" (default: "lines"). |
"lines" |
removeDuplicates |
Boolean | Whether to deduplicate matches (default: false). |
false |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/text/extractor \
-H "Content-Type: application/json" \
-d '{
"rawText": "[2026-08-25] [INFO] User alice logged in from 192.168.1.1",
"mode": "delimiters",
"startDelimiter": "[",
"endDelimiter": "]"
}'Python
import requests
url = "https://blueutils.com/api/text/extractor"
payload = {
"rawText": "[2026-08-25] [INFO] User alice logged in from 192.168.1.1",
"mode": "delimiters",
"startDelimiter": "[",
"endDelimiter": "]"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawText": "[2026-08-25] [INFO] User alice logged in from 192.168.1.1",
"mode": "delimiters",
"startDelimiter": "[",
"endDelimiter": "]"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/text/extractor"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether extraction succeeded. | true |
extractedItems |
Array | Array of extracted string matches. | ["2026-08-25", "INFO"] |
extractedText |
String | Formatted output text. | "2026-08-25\nINFO" |
stats |
Object | Match count, unique count, and lines processed metrics. | { "totalFound": 2, "uniqueCount": 2 } |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"extractedItems": [
"2026-08-25",
"INFO"
],
"extractedText": "2026-08-25\nINFO",
"stats": {
"totalFound": 2,
"uniqueCount": 2,
"linesProcessed": 1,
"mode": "delimiters"
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Text input cannot be empty."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to extract text?
- ETL Data Pipelines: Isolate IDs, UUIDs, and foreign keys from unstructured log lines before warehouse loading.
- Log Processing Microservices: Ingest syslog streams and extract IP addresses, trace IDs, and HTTP status codes dynamically.
Native Usage
How to extract text locally in terminal environments:
Windows (PowerShell)
# Extract text between brackets in PowerShell
$text = "[2026-08-25] [INFO] User logged in"
[regex]::Matches($text, '\[(.*?)\]') | ForEach-Object { $_.Groups[1].Value }Linux / Unix (Bash)
# Extract text between delimiters using grep and sed in Bash
echo "[2026-08-25] [INFO] User logged in" | grep -oP '\[\K[^\]]+'Python
Using Python standard library:
import re
text = "[2026-08-25] [INFO] User alice logged in"
matches = re.findall(r'\[(.*?)\]', text)
print(matches)Java
Using Java standard library:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TextExtract {
public static void main(String[] args) {
String input = "[2026-08-25] [INFO] User alice logged in";
Pattern pattern = Pattern.compile("\\[(.*?)\\]");
Matcher matcher = pattern.matcher(input);
while (matcher.find()) {
System.out.println(matcher.group(1));
}
}
}