Skip to content

Commit

Permalink
Adjust comments
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed Oct 29, 2024
1 parent d7e0379 commit 0292670
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@
"verifyBuild": true,
"verifyOutput": true,
"isLearnByExample": true
}
},
{
"name": "RegExp match operations",
"url": "regexp-match-operations",
Expand Down
3 changes: 2 additions & 1 deletion examples/regexp-match-operations/regexp_match_operations.bal
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function main() returns error? {
boolean isValidProductCode = productCodePattern.isFullMatch(productCode);
io:println(string `Product Code: ${productCode}, Valid: ${isValidProductCode}`);

// If the product code is invalid, skip further processing.
if !isValidProductCode {
continue;
}
Expand All @@ -22,7 +23,7 @@ public function main() returns error? {
if matchGroups is regexp:Groups {
// The first member in the `matchGroups` tuple is the entire matched string.
// The subsequent members represent the captured groups
// (assigned to `productType` and `uniqueID` respectively).
// corresponding to product type and unique ID respectively.
io:println("Product Type: ",
(check matchGroups[1].ensureType(regexp:Span)).substring());
io:println("Unique ID: ",
Expand Down

0 comments on commit 0292670

Please sign in to comment.