Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 8af0fc9

Browse files
📝 Added PatternMaker Docs
1 parent 6e5479c commit 8af0fc9

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed

‎src/SomeUtils/Pattern/README.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,184 @@ public String[][] getArray();
5656

5757
Get the internal array to be used later on.
5858

59+
---
60+
61+
## PatternMaker.java
62+
63+
```java
64+
import SomeUtils.Pattern.PatternMaker;
65+
```
66+
67+
---
68+
69+
### Public Variables
70+
71+
---
72+
73+
```java
74+
/**From Pattern.java
75+
*Go to their website for more details:
76+
*https://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip...
77+
*.../src/share/classes/java/util/regex/Pattern.java
78+
**/
79+
public static final int UNIX_LINES=0x01;
80+
public static final int CASE_INSENSITIVE=0x02;
81+
public static final int COMMENTS=0x04;
82+
public static final int MULTILINE=0x08;
83+
public static final int LITERAL=0x10;
84+
public static final int DOTALL=0x20;
85+
public static final int CANON_EQ=0x80;
86+
public static final int UNICODE_CHARACTER_CLASS=0x100;
87+
```
88+
89+
These are the flags to be passed to the #compile() method.
90+
91+
---
92+
93+
### Public Methods
94+
95+
---
96+
97+
```java
98+
public PatternMaker();
99+
public PatternMaker(final String in);
100+
public PatternMaker(final Pattern in);
101+
```
102+
103+
Create an instance either by...
104+
105+
...Passing nothing...
106+
107+
...Passing an initial String regex...
108+
109+
...Or by passing an already compiled Pattern/regex.
110+
111+
---
112+
113+
```java
114+
public PatternMaker add(final String in);
115+
```
116+
117+
Pass a specified/custom String into the internal StringBuilder.
118+
119+
---
120+
121+
```java
122+
public PatternMaker anyOf(final String in);
123+
public PatternMaker notAnyOf(final String in);
124+
```
125+
126+
Match any of or anything that is not any of the char(s).
127+
128+
---
129+
130+
```java
131+
public PatternMaker rangeOf(final char in, final char in2)
132+
```
133+
134+
Find a character in a certain range.
135+
136+
Should be used either with #anyOf() or #notAnyOf.
137+
138+
---
139+
140+
```java
141+
public PatternMaker or(final String in);
142+
```
143+
144+
Adds an or statement.
145+
146+
Should be used either with #anyOf() or #notAnyOf.
147+
148+
---
149+
150+
```java
151+
public PatternMaker any();
152+
```
153+
154+
Match any char.
155+
156+
---
157+
158+
```java
159+
public PatternMaker beginsWith(final String in);
160+
public PatternMaker endsWith(final String in);
161+
```
162+
163+
Check for a match in the beginning or end of a String.
164+
165+
---
166+
167+
```java
168+
public PatternMaker anyNumber();
169+
```
170+
171+
Match for any number/digit, from 0 to 9.
172+
173+
---
174+
175+
```java
176+
public PatternMaker whitespace();
177+
```
178+
179+
Match for any kind of whitespace.
180+
181+
---
182+
183+
```java
184+
public PatternMaker wordBoundary();
185+
```
186+
187+
Match for a pattern before or after a word boundary.
188+
189+
---
190+
191+
```java
192+
public PatternMaker unicode(final String in);
193+
```
194+
195+
Match for a certain unicode character.
196+
197+
---
198+
199+
```java
200+
public PatternMaker once();
201+
public PatternMaker noneOrMore();
202+
public PatternMaker onceOrNone();
203+
public PatternMaker atleastOnce();
204+
public PatternMaker occurOnly(final int in);
205+
public PatternMaker atleast(final int in);
206+
public PatternMaker atleastRange(final int from, final int to);
207+
```
208+
209+
Match only for a certain amount of times.
210+
211+
---
212+
213+
```java
214+
public PatternMaker captureRecent();
215+
```
216+
217+
Capture the recent pattern.
218+
219+
In other words, remember the match.
220+
221+
---
222+
223+
```java
224+
public Pattern compile();
225+
public Pattern compile(final int in);
226+
```
227+
228+
Compile the Pattern either with or without a flag.
229+
230+
---
231+
232+
```java
233+
@Override
234+
public String toString();
235+
```
236+
237+
Get the Pattern as a String.
238+
59239
---

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /