User Tools

Site Tools


action:Search_using_Regular_Expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
action:Search_using_Regular_Expression [2018/04/09 00:33]
JMichaelTX
action:Search_using_Regular_Expression [2022/04/17 17:37] (current)
ccstone [Examples]
Line 1: Line 1:
-====== Search using Regular Expression ======+====== Search using Regular Expression ​Action ​======
 {{:​regex-icon.png?​nolink|}} {{:​regex-icon.png?​nolink|}}
  
 The //Search using Regular Expression//​ action allows you to search a clipboard, variable, a file (v8+) or some text (v8+) for a [[:Regular Expressions|regular expression]] and capture what you find to one or more variables. This can be very useful for splitting apart the contents of a variable. The //Search using Regular Expression//​ action allows you to search a clipboard, variable, a file (v8+) or some text (v8+) for a [[:Regular Expressions|regular expression]] and capture what you find to one or more variables. This can be very useful for splitting apart the contents of a variable.
 +
 +:!:  **Note: ​ This RegEx Search returns _only the first_ match in the source text.**\\
 +If you want to process _all_ matches, you will need to use a [[action:​For_Each|For Each Action]] as [[:​Regular_Expressions#​Examples|Shown in this Example]].
  
 {{:​action:​search-using-regex.png?​nolink&​516|}} {{:​action:​search-using-regex.png?​nolink&​516|}}
Line 43: Line 46:
 then you would use a RegEx pattern like:\\ then you would use a RegEx pattern like:\\
 `(SKU\d{4})\h(.+)\h(.+)` `(SKU\d{4})\h(.+)\h(.+)`
 +
 +To see a detailed explanation,​ and live editor, see https://​regex101.com/​r/​MQ5FwG/​1/​.\\
  
 Save the first and third bracketed items (Capture Groups) to save the SKU number and the price. ​ Save the first and third bracketed items (Capture Groups) to save the SKU number and the price. ​
Line 48: Line 53:
 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. 
  
-{{:​action:​searchvariableexample.png|}}+{{:​action:​searchvariableexample.png?514|}}
  
 Which results in: Which results in:
  
-{{:​action:​searchvariableresult.png|}}+{{:​action:​searchvariableresult.png?345|}}
  
 ===== See Also ===== ===== See Also =====
action/Search_using_Regular_Expression.1523248384.txt.gz ยท Last modified: 2018/04/09 00:33 by JMichaelTX