Skip to content

Commit

Permalink
Update regex and folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed Oct 21, 2024
1 parent bac1a43 commit 6168c29
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ballerina/io;

public function main() {
string creditCardNumber = "1234-5678-9876-5432";
string:RegExp pattern = re `(\d{4})-(\d{4})-(\d{4})`;
string:RegExp pattern = re `\d{4}-\d{4}-\d{4}`;
// Replace the first occurrence of the credit card pattern with a masked representation.
string maskedCardNumber = pattern.replace(creditCardNumber, "****-****-****");
io:println(maskedCardNumber);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$ bal run regexp_replace_operations.bal
****-****-****-5432
XML string with comments removed: <root><e1>value1</e1><e2>value2</e2>&gt;</root>
XML string with comments removed: <root><e1>value1</e1><e2>value2</e2>&gt;</root>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$ bal run regexp_operations.bal
$ bal run regexp_operations_overview.bal
["[email protected]","[email protected]","[email protected]","[email protected]","invalid#@example.n%t"]
["bob","alice","charlie","david"]
["example.net","example.com","example.org","example.xyz"]

0 comments on commit 6168c29

Please sign in to comment.