Skip to content

Commit a7d767f

Browse files
committed
bump: 0.0.2
1 parent 761f3e6 commit a7d767f

24 files changed

+328
-99
lines changed

.idea/sonarlint/issuestore/5/8/5879b52636e240d2cfcbd5e54543d3959f957811

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sonarlint/issuestore/5/a/5a503c465e2e403dbd4c3fe2906c7cecc8e13602

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sonarlint/issuestore/8/8/8821b29c537b8a99cd1bc3d5df88d632f6f5d314

Whitespace-only changes.

.idea/sonarlint/issuestore/d/c/dcba94fd99e9396082d1fedd3522764f78825365

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sonarlint/issuestore/f/9/f9465a1df802c670887a6edc9706fd150e19342b

Whitespace-only changes.

.idea/sonarlint/issuestore/index.pb

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sonarlint/securityhotspotstore/5/8/5879b52636e240d2cfcbd5e54543d3959f957811

Whitespace-only changes.

.idea/sonarlint/securityhotspotstore/5/a/5a503c465e2e403dbd4c3fe2906c7cecc8e13602

Whitespace-only changes.

.idea/sonarlint/securityhotspotstore/8/8/8821b29c537b8a99cd1bc3d5df88d632f6f5d314

Whitespace-only changes.

.idea/sonarlint/securityhotspotstore/f/9/f9465a1df802c670887a6edc9706fd150e19342b

Whitespace-only changes.

.idea/sonarlint/securityhotspotstore/index.pb

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/uiDesigner.xml

+124
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+19-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import io.github.multiform_validator.Validator;
1818
import io.github.multiform_validator.EmailValidator;
1919
import io.github.multiform_validator.CpfValidator;
2020
import io.github.multiform_validator.CnpjValidator;
21+
import io.github.multiform_validator.Utils;
2122

2223
public class Main {
2324
public static void main(String[] args) {
@@ -32,6 +33,13 @@ public class Main {
3233

3334
System.out.println(Validator.isAscii("foo")); // true
3435
System.out.println(Validator.isAscii("foo©")); // false
36+
37+
System.out.println(Utils.getOnlyEmail("This is an example [email protected] bla yes my friend loren ipsun")); // [email protected]
38+
System.out.println(Utils.getOnlyEmail("This is an example bla yes my friend loren ipsun")); // null
39+
// With options
40+
Utils.GetOnlyEmailOptionsParams options = new Utils.GetOnlyEmailOptionsParams();
41+
options.multiple = true;
42+
System.out.println(Utils.getOnlyEmail("This is an example [email protected] bla [email protected] yes yes", options)); // [[email protected], [email protected]]
3543
}
3644
}
3745
```

multiform-validator.iml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module version="4">
33
<component name="SonarLintModuleSettings">
4-
<option name="uniqueId" value="87b94a39-8d05-4761-9afa-26b585acd5d2" />
4+
<option name="uniqueId" value="c5c54ae9-3385-42e1-a3bd-58c981c046ca" />
55
</component>
66
</module>

pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github</groupId>
88
<artifactId>multiform-validator</artifactId>
9-
<version>0.0.1</version>
9+
<version>0.0.2</version>
1010

1111
<name>Multiform Validator</name>
1212
<description>
@@ -31,6 +31,7 @@
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3333
</properties>
34+
3435
<dependencies>
3536
<dependency>
3637
<groupId>org.jetbrains</groupId>

src/main/java/io/github/multiform_validator/CnpjValidator.java

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public static boolean cnpjIsValid(String cnpj) {
4848
return false;
4949
}
5050

51+
// Check if all digits are the same
52+
if (cnpjClean.chars().distinct().count() <= 1) {
53+
return false;
54+
}
55+
5156
// Convert the string to an array of integers
5257
final int[] cnpjArray = cnpjClean.chars().map(Character::getNumericValue).toArray();
5358

src/main/java/io/github/multiform_validator/EmailValidator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static boolean isEmail(String email) {
1515
throw new NullPointerException("Email cannot be null");
1616
}
1717

18-
final Pattern startsWithSpecialChar = Pattern.compile("^[^a-zA-Z0-9]");
18+
final Pattern startsWithSpecialChar = Pattern.compile("^[^a-zA-Z]");
1919

2020
if (startsWithSpecialChar.matcher(email).find()) {
2121
return false;

0 commit comments

Comments
 (0)