Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v2) • Re: New to Regex - pls help

$
0
0
Welcome to this AutoHotkey forum!

CODE:

#Requires AutoHotkey v2.0
str := '
(
lots oh html
<span>🍑Eat steak🍑 </span><span>41</span>
more html
<span>🍑Hold horse🍑 </span><span>30</span>
more html
<span>🍑Eat vegies🍑 </span><span>30</span>
more html
)'
regex := 'i)\b(Eat [\w ]+).*?<span>(\d+)'
pos := out := ''
While pos := RegExMatch(str, regex, &m, pos ? pos + StrLen(m[]) : 1)
out .= (out = '' ? '' : '`n') m[1] ' - ' m[2]
MsgBox out, 'Eating', 'Iconi'

Statistics: Posted by mikeyww — Today, 09:56



Viewing all articles
Browse latest Browse all 579

Trending Articles