RegExMatch (easy) Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fedek
Posts: 60
Joined: 17 May 2016, 12:17
Contact:

RegExMatch (easy)

29 Jul 2017, 03:16

Hi, i have some text here. How to get to a variable everything from "Описание задания: "(`n) to "Внимание!", not including it. And where i can read about RegExMathc excluding help.
Spoiler
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: RegExMatch (easy)  Topic is solved

29 Jul 2017, 03:40

Like this?

Code: Select all

q::
vText := " ;continuation section
(Join`r`n
Автор:
Категория Социальные сети
Отзывы о задании Отзывов нет
Все задания автора Смотреть
Избранное
Добавить
Мои отчёты на этом задании Смотреть
Статистика по заданию
Описание задания:
страниц https://vk.com/_45%2Fall
Ссылка для выполнения этого задания: https://vk.com/?w=wall41622_45%2Fall
Внимание!
)"

vNeedle := "s)Описание задания:.*(?=Внимание!)"
;vNeedle := "s)Описание задания:.*?(?=Внимание!)" ;sometimes the question mark useful to make it ungreedy
RegExMatch(vText, vNeedle, vMatch)
MsgBox, % "[" vMatch "]"
Clipboard := vMatch
return
Also:
jeeswg's RegEx tutorial (RegExMatch, RegExReplace) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28031

Although this is very useful:
Regular Expressions (RegEx) - Quick Reference
https://www.autohotkey.com/docs/misc/RegEx-QuickRef.htm
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: cjsmile999 and 364 guests