Skip to content

Commit

Permalink
Remove regex usages
Browse files Browse the repository at this point in the history
  • Loading branch information
dilanSachi committed Feb 28, 2024
1 parent 6b1e004 commit b7ef635
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
20 changes: 5 additions & 15 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ version = "0.0.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
modules = [
{org = "ballerina", packageName = "lang.regexp", moduleName = "lang.regexp"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -267,19 +270,6 @@ modules = [
{org = "ballerina", packageName = "os", moduleName = "os"}
]

[[package]]
org = "ballerina"
name = "regex"
version = "1.4.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.string"}
]
modules = [
{org = "ballerina", packageName = "regex", moduleName = "regex"}
]

[[package]]
org = "ballerina"
name = "task"
Expand Down Expand Up @@ -321,15 +311,15 @@ dependencies = [
[[package]]
org = "ballerinax"
name = "azure.ad"
version = "2.3.0"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.regexp"},
{org = "ballerina", name = "lang.runtime"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "regex"},
{org = "ballerina", name = "test"},
{org = "ballerinax", name = "client.config"}
]
Expand Down
6 changes: 3 additions & 3 deletions ballerina/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import ballerina/jballerina.java;
import ballerina/lang.runtime;
import ballerina/log;
import ballerina/os;
import ballerina/regex;
import ballerina/test;
import ballerina/lang.regexp;

configurable string & readonly refreshUrl = os:getEnv("REFRESH_URL");
configurable string & readonly refreshToken = os:getEnv("REFRESH_TOKEN");
Expand Down Expand Up @@ -541,8 +541,8 @@ function testDeleteUserAndGroup() {
# + return - A string UUID without hyphens
function createRandomUUIDWithoutHyphens() returns string {
string? stringUUID = java:toString(createRandomUUID());
if (stringUUID is string) {
return 'string:substring(regex:replaceAll(stringUUID, "-", ""), 1, 4);
if stringUUID is string {
return 'string:substring(regexp:replaceAll(re`-`, stringUUID, ""), 1, 4);
} else {
return EMPTY_STRING;
}
Expand Down

0 comments on commit b7ef635

Please sign in to comment.