Skip to content

Commit 711e090

Browse files
committed
Added a guide to explain how to combine regular expressions
Added a full documentation to explain the process of certificates creation and how to make a self signing certificate seen as a true signed certificate by a certification authority on Windows and Android
1 parent 63d2cc8 commit 711e090

File tree

5 files changed

+829
-0
lines changed

5 files changed

+829
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to the AI MultiBarcode Capture Application are documented in this file.
44

5+
#### 📚 **Wiki Updates:**
6+
7+
**📚 [Complete Regex Pattern Library](wiki/16-Common-Regex-Expressions.md)**: Comprehensive collection of 300+ regex patterns covering web URLs, device identifiers, government IDs, license plates, postal codes, phone numbers, and industry standards
8+
9+
**🔐 [Understanding Certificates for Beginners](wiki/17-Understanding-Certificates-For-Beginners.md)**: Complete beginner's guide explaining certificate creation, platform-specific requirements, and how to create self-signed certificates that Windows and Android recognize as legitimate Certificate Authority certificates
10+
511
## Version 1.29 - 🔍 **Advanced Barcode Filtering System**
612

713
**Enhanced barcode processing capabilities with intelligent pattern-based filtering for precision data capture.**

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ https://github.com/ltrudu/AI_MutliBarcodes_Capture
1515

1616
## 📅 What's New
1717

18+
#### 📚 **Wiki Updates:**
19+
20+
**📚 [Complete Regex Pattern Library](wiki/16-Common-Regex-Expressions.md)**: Comprehensive collection of 300+ regex patterns covering web URLs, device identifiers, government IDs, license plates, postal codes, phone numbers, and industry standards
21+
22+
**🔐 [Understanding Certificates for Beginners](wiki/17-Understanding-Certificates-For-Beginners.md)**: Complete beginner's guide explaining certificate creation, platform-specific requirements, and how to create self-signed certificates that Windows and Android recognize as legitimate Certificate Authority certificates
23+
1824
### Version 1.29 - 🔍 **Advanced Barcode Filtering System**
1925

2026
**Enhanced barcode processing capabilities with intelligent pattern-based filtering for precision data capture.**

wiki/16-Common-Regex-Expressions.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,83 @@
22

33
This comprehensive guide provides robust regular expressions for filtering barcodes based on common data patterns. These expressions are optimized to minimize false positives and false negatives.
44

5+
## 🔧 How to Combine Multiple Patterns
6+
7+
### Understanding Pattern Combination
8+
9+
When you need to match **multiple formats** with a single regex pattern, you can combine them using the **OR operator** (`|`). This allows you to create one pattern that matches any of several different formats.
10+
11+
### Basic Syntax
12+
13+
**Format**: `^(pattern1|pattern2|pattern3)$`
14+
15+
**Explanation**:
16+
- `^` - Start of string
17+
- `(` - Begin group
18+
- `pattern1|pattern2|pattern3` - Match pattern1 OR pattern2 OR pattern3
19+
- `)` - End group
20+
- `$` - End of string
21+
22+
### Practical Example: Web Protocols
23+
24+
Let's combine HTTP, HTTPS, and FTP patterns from this document:
25+
26+
#### Individual Patterns:
27+
- **HTTP**: `^http://[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(\:[0-9]{1,5})?(\/[^\s]*)?$`
28+
- **HTTPS**: `^https://[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(\:[0-9]{1,5})?(\/[^\s]*)?$`
29+
- **FTP**: `^ftp://[a-zA-Z0-9.-]+(\:[0-9]{1,5})?(/[^\s]*)?$`
30+
31+
#### Combined Pattern:
32+
```regex
33+
^(http://[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(\:[0-9]{1,5})?(\/[^\s]*)?|https://[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(\:[0-9]{1,5})?(\/[^\s]*)?|ftp://[a-zA-Z0-9.-]+(\:[0-9]{1,5})?(/[^\s]*)?)$
34+
```
35+
36+
#### Simplified Alternative:
37+
For web protocols, you can use this more efficient pattern:
38+
```regex
39+
^(https?|ftp)://[a-zA-Z0-9.-]+(\:[0-9]{1,5})?(/[^\s]*)?$
40+
```
41+
42+
**Explanation**:
43+
- `https?` - Matches "http" or "https" (the `?` makes the 's' optional)
44+
- `|ftp` - OR matches "ftp"
45+
46+
### More Examples
47+
48+
#### Phone Numbers (International + Local):
49+
```regex
50+
^(\+33[67][0-9]{8}|0[67][0-9]{8})$
51+
```
52+
**Matches**: `+33650203370` OR `0650203370`
53+
54+
#### Product Codes (Multiple Formats):
55+
```regex
56+
^([0-9]{12}|[0-9]{13}|[0-9]{8})$
57+
```
58+
**Matches**: UPC-A (12 digits) OR EAN-13 (13 digits) OR EAN-8 (8 digits)
59+
60+
#### Email + Phone:
61+
```regex
62+
^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}|\+?[0-9\s\-\(\)\.]{10,15})$
63+
```
64+
**Matches**: Email addresses OR phone numbers
65+
66+
### Quick Tips
67+
68+
1. **Keep it Simple**: Start with 2-3 patterns, then expand as needed
69+
2. **Test Your Patterns**: Use online regex testers before implementing
70+
3. **Order Matters**: Put more specific patterns before general ones
71+
4. **Use Parentheses**: Always wrap your OR groups in parentheses
72+
5. **Common Prefixes**: Look for shared parts to simplify (like `https?` for HTTP/HTTPS)
73+
74+
### Pattern Testing
75+
76+
**Test your combined patterns with these examples**:
77+
-`http://example.com` - Should match
78+
-`https://secure.example.com:443/path` - Should match
79+
-`ftp://files.example.com/download` - Should match
80+
-`invalid://bad.url` - Should NOT match
81+
582
## 📋 Table of Contents
683

784
### 🌐 [Digital & Web Identifiers](#-digital--web-identifiers)

0 commit comments

Comments
 (0)