action:Search_using_Regular_Expression
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| action:Search_using_Regular_Expression [2017/09/07 08:09] – created peternlewis | action:Search_using_Regular_Expression [2022/04/17 21:37] (current) – [Examples] ccstone | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | The //Search using Regular Expression// | + | ====== Search using Regular Expression Action ====== |
| + | {{: | ||
| + | |||
| + | The //Search using Regular Expression// | ||
| + | |||
| + | :!: **Note: | ||
| + | If you want to process _all_ matches, you will need to use a [[action: | ||
| {{: | {{: | ||
| - | Select the source to search to search using the //Search// pop-up. | + | ===== How To Use ===== |
| - | You can search for Regular Expression, matching case sensitively or ignoring the case. | + | ==== Source ==== |
| - | Select | + | Select |
| - | Select where to save results with the //and save capture groups to Variables// section. The entire match, and each capture group (enclosed in brackets) can be saved to variables. | + | ==== Case Sensitivity ==== |
| - | If the search fails, by default (7.1+) | + | Select whether or not to match the case from the //using Regular Expression// |
| - | Examples: | + | ==== RegEx Pattern |
| - | * Use a regular expression | + | |
| + | Then enter the RegEx pattern to search for in the text area. | ||
| - | Given a line like | + | ==== Save Capture Groups to Variables ==== |
| - | // | + | Enter the [[manual: |
| - | this could look like the following: | + | For more information, |
| - | Search | + | ==== Handling |
| - | And capture: the first and third bracketed items to save only the SKU number and the price. | + | If the search fails (no match), by default (7.1+) the action will abort the macro and notify you of the failure. |
| + | |||
| + | ===== Examples ===== | ||
| + | |||
| + | **1. Use a regular expression to search through a product price list and save only certain parts of it.** | ||
| + | |||
| + | |||
| + | If your Source String (data) is: | ||
| + | ```text | ||
| + | SKU1234Δ | ||
| + | ``` | ||
| + | (the " | ||
| + | |||
| + | then you would use a RegEx pattern like:\\ | ||
| + | `(SKU\d{4})\h(.+)\h(.+)` | ||
| + | |||
| + | To see a detailed explanation, | ||
| + | |||
| + | Save the first and third bracketed items (Capture Groups) | ||
| To work through a list you would need to include a loop or repeat of some kind. | To work through a list you would need to include a loop or repeat of some kind. | ||
| - | {{: | + | {{: |
| Which results in: | Which results in: | ||
| - | {{: | + | {{: |
| ===== See Also ===== | ===== See Also ===== | ||
| - | |||
| - | ---- | ||
| === Actions === | === Actions === | ||
| - | * [[action: | ||
| - | * [[action: | ||
| * [[: | * [[: | ||
| Line 48: | Line 68: | ||
| * [[:Regular Expressions|Regular Expressions]] | * [[:Regular Expressions|Regular Expressions]] | ||
| - | + | * [[: | |
| - | ---- | + | |
| ==== Forum ==== | ==== Forum ==== | ||
action/Search_using_Regular_Expression.1504771795.txt.gz · Last modified: by peternlewis
