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] – [Topics] 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 ===== |
| + | |||
| + | ==== Source ==== | ||
| + | |||
| + | Select the source to search to search using the //Search// pop-up. | ||
| + | |||
| + | ==== Case Sensitivity ==== | ||
| + | |||
| + | Select whether or not to match the case from the //using Regular Expression// | ||
| + | |||
| + | ==== RegEx Pattern to Search For ==== | ||
| + | |||
| + | Then enter the RegEx pattern to search for in the text area. | ||
| + | |||
| + | ==== Save Capture Groups to Variables ==== | ||
| - | You can search | + | Enter the [[manual: |
| - | Select whether or not to match the case from the //using Regular Expression// | + | For more information, |
| - | 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. | + | ==== Handling Search Failure ==== |
| - | If the search fails, by default (7.1+) the action will abort the macro and notify you of the failure. | + | If the search fails (no match), by default (7.1+) the action will abort the macro and notify you of the failure. |
| - | Examples: | + | ===== Examples |
| - | * Use a regular expression to search through a product price list and save only certain parts of it. | + | |
| + | **1. Use a regular expression to search through a product price list and save only certain parts of it.** | ||
| - | Given a line like | ||
| - | //SKU1234 Widget 1 $12.95// | + | If your Source String (data) is: |
| + | ```text | ||
| + | SKU1234Δ | ||
| + | ``` | ||
| + | (the " | ||
| - | this could look like the following: | + | then you would use a RegEx pattern |
| + | `(SKU\d{4})\h(.+)\h(.+)` | ||
| - | Search for: (SKU\d{4})\t(.+)\t(.+) | + | To see a detailed explanation, |
| - | And capture: | + | 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 ===== | ||
action/Search_using_Regular_Expression.1504771897.txt.gz · Last modified: by peternlewis
