#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)PLF2"
Local $sString = "import React from 'react';" & @CRLF & _
"import { useState } from 'react';" & @CRLF & _
"" & @CRLF & _
"export default function UserForm() {" & @CRLF & _
" const [students, setStudents] = useState([" & @CRLF & _
" { id: 1, name: 'Anna', age: 18 }," & @CRLF & _
" { id: 2, name: 'Tom', age: 17 }," & @CRLF & _
" ]);" & @CRLF & _
"" & @CRLF & _
" const [name, setName] = useState('');" & @CRLF & _
" const [age, setAge] = useState(0);" & @CRLF & _
"" & @CRLF & _
" const handleSubmit = (event) => {" & @CRLF & _
" event.preventDefault();" & @CRLF & _
" };" & @CRLF & _
"" & @CRLF & _
" const newStudent = {" & @CRLF & _
" id: Date.now()," & @CRLF & _
" name: name," & @CRLF & _
" age: age," & @CRLF & _
" };" & @CRLF & _
"" & @CRLF & _
" setStudents([...students, newStudent]);" & @CRLF & _
" setName('');" & @CRLF & _
" setAge(0);" & @CRLF & _
"" & @CRLF & _
" return (" & @CRLF & _
" <div>" & @CRLF & _
" <ul>" & @CRLF & _
" {students.map((student) => (" & @CRLF & _
" <li key={student.id}>" & @CRLF & _
" {student.name}" & @CRLF & _
" {student.age}" & @CRLF & _
" </li>" & @CRLF & _
" ))}" & @CRLF & _
" </ul>" & @CRLF & _
" <form onSubmit={handleSubmit}>" & @CRLF & _
" <input" & @CRLF & _
" type="text"" & @CRLF & _
" value={name}" & @CRLF & _
" onChange={(e) => setName(e.target.value)}" & @CRLF & _
" />" & @CRLF & _
" <input" & @CRLF & _
" type="number"" & @CRLF & _
" value={age}" & @CRLF & _
" onChange={(e) => setAge(e.target.value)}" & @CRLF & _
" />" & @CRLF & _
" <button type="submit"> Hinzufügen</button>" & @CRLF & _
" </form>" & @CRLF & _
" ;" & @CRLF & _
" </div>" & @CRLF & _
" );" & @CRLF & _
"}" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm