diff --git a/swan-lake/by-example/configuring-via-toml/content.jsx b/swan-lake/by-example/configuring-via-toml/content.jsx index c7c62c7f271..67af1656304 100644 --- a/swan-lake/by-example/configuring-via-toml/content.jsx +++ b/swan-lake/by-example/configuring-via-toml/content.jsx @@ -34,11 +34,17 @@ public function main() { io:println("admin details: ", admin); io:println("users: ", users); } +`, + `maxPayload = 3.21 +acceptTypes = ["application/xml", "application/json", "text/plain"] +admin = {username = "admin", password = "password"} +users = [{username = "John", password = "abc123"}, {username = "Bob", password = "cde456"}] `, ]; export function ConfiguringViaToml({ codeSnippets }) { const [codeClick1, updateCodeClick1] = useState(false); + const [codeClick2, updateCodeClick2] = useState(false); const [outputClick1, updateOutputClick1] = useState(false); const ref1 = createRef(); @@ -161,6 +167,95 @@ export function ConfiguringViaToml({ codeSnippets }) { +
+ To run the example, copy the following content to a file named{" "}
+ Config.toml
in the current directory.
+
A RegExp
value can be created by using the regexp template
- expression or calling the fromString
method of the{" "}
+ expression or calling the{" "}
- lang.regexp
+ fromString
method of the lang.regexp
{" "}
module.
{`\$ bal run regexp_type.bal`}
+ {`Pattern \`[a-zA-Z0-9]\` matches \`a\`: true`}
+ {`Pattern \`[a-zA-Z0-9]\` matches \`a1\`: false`}
{`Pattern \`HELLO*\` matches \`HELLO\`: true`}
{`Pattern \`a+\` matches \`aaa\`: true`}
{`Pattern \`abc|\${"xyz"}\` matches \`xyz\`: true`}
@@ -263,7 +274,7 @@ export function RegexpType({ codeSnippets }) {
•
- RegExp API Docs
+ regexp
langlib API Docs
@@ -273,7 +284,17 @@ export function RegexpType({ codeSnippets }) {
•
- string API Docs
+ string
langlib API Docs
+
+
+
+
+