Skip to content

Commit

Permalink
add useful regex examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuergen committed May 28, 2024
1 parent c4ef54b commit 595af41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,17 @@ A complete overview of the shortcuts in `VS Code`/`AX Coce` you'll find here: [V

![regex](img/regex.gif)

Valuable search&replace patterns:
Useful search&replace patterns when you want to migrate SCL Code (exported from TIA Portal) into ST:
||Search field| Replace field|Example|
|-|-|-|-|
| Remove all # for variables of a SCL source | #([A-Za-z]) | $1 | #statVariable --> statVariable
| Remove all { S7_SetPoint := 'False' ... } | \{[A-Za-z0-9 :=';_.]*\} | | Bin2 { S7_SetPoint := 'False'} : "typeStatisticsBin"; --> Bin2 : "typeStatisticsBin"
| Remove "name" | "([A-Za-z]*)" | $1 | |
| TIA-Type to ST-Type | TYPE "([A-Za-z0-9_]*)" | TYPE $1 : | |
| Remove `"` in type declaration | "([A-Za-z0-9_]*)" | $1

> thats's not a migration guide and it's still manual necessary. But it can make the life easier.
## Further information

[AX Code Documentation](https://console.simatic-ax.siemens.io/docs/axcode/vscode-user-snippets)
Expand Down

0 comments on commit 595af41

Please sign in to comment.