action:Search_using_Regular_Expression
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| action:Search_using_Regular_Expression [2017/09/07 08:11] – [See Also] peternlewis | action:Search_using_Regular_Expression [2026/10/07 03:36] (current) – minor cleanup peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | The //Search using Regular Expression// | + | ====== Search using Regular Expression Action ====== |
| + | |||
| + | The //Search using Regular Expression// | ||
| {{: | {{: | ||
| - | Select | + | **Note: |
| - | You can search for Regular Expression, matching case sensitively or ignoring the case. | + | ===== How To Use ===== |
| - | Select whether or not to match the case from the //using Regular Expression// | + | ==== Source ==== |
| - | Select | + | Select |
| - | If the search fails, by default (7.1+) the action will abort the macro and notify you of the failure. | + | ==== Case Sensitivity ==== |
| - | Examples: | + | Select whether or not to match the case from the //using Regular Expression// |
| - | * Use a regular expression | + | |
| + | ==== RegEx Pattern to Search For ==== | ||
| - | Given a line like | + | Then enter the RegEx pattern to search for in the text area. |
| - | // | + | ==== Save Capture Groups to Variables ==== |
| - | this could look like the following: | + | Enter the [[manual:Variables|Variable]] for each the entire Match and each Capture Group you wish to save as a Variable. |
| - | Search for: (SKU\d{4})\t(.+)\t(.+) | + | For more information, |
| - | And capture: the first and third bracketed items to save only the SKU number and the price. | + | ==== Handling Search Failure ==== |
| + | |||
| + | 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 ===== | ||
| Line 44: | Line 66: | ||
| * [[:Regular Expressions|Regular Expressions]] | * [[:Regular Expressions|Regular Expressions]] | ||
| - | + | * [[: | |
| - | ---- | + | |
| ==== Forum ==== | ==== Forum ==== | ||
action/Search_using_Regular_Expression.1504771878.txt.gz · Last modified: by peternlewis
