Search found 5 matches

by Injuste
23 Jul 2018, 09:38
Forum: Ask for Help (v1)
Topic: Finding the number between two words in a text - RegEx
Replies: 6
Views: 1627

Re: Finding the number between two words in a text - RegEx

MannyKSoSo wrote:

Code: Select all

text := "this 54.8 is a 51 test 88888888888.1 hehe"
RegExMatch(text, "(?<=test\s)\d+\.?\d+?", output)
msgbox, %output%
Oh got it, it works. Thanks a lot. Problem solved.
by Injuste
23 Jul 2018, 09:21
Forum: Ask for Help (v1)
Topic: Finding the number between two words in a text - RegEx
Replies: 6
Views: 1627

Re: Finding the number between two words in a text - RegEx

If the two word are always the same you could do this "(?<=Test )[^\d.]+(?= hehe)" text := "this 54.8 is a 51 test 88888888888.1 hehe" RegExMatch(text, "(?<=test )[^\d.]+(?= hehe)", output) msgbox, %output% Doesn't work, message box pops up empty. I guess I did something wrong with syntax, can you ...
by Injuste
23 Jul 2018, 09:04
Forum: Ask for Help (v1)
Topic: Finding the number between two words in a text - RegEx
Replies: 6
Views: 1627

Re: Finding the number between two words in a text - RegEx

Rohwedder wrote:Hallo,
do you want this?:

Code: Select all

#SingleInstance, Force
text := "this 54.8 is a 51 test 88888888888.1 hehe"

output := RegExReplace(text, "[^\d.]+", " ")
msgbox, %output%
Wow it's awesome thank you but I don't need all of them, I just need to get 88888888888.1 from it. Since it's between two words.
by Injuste
23 Jul 2018, 08:04
Forum: Ask for Help (v1)
Topic: Finding the number between two words in a text - RegEx
Replies: 6
Views: 1627

Finding the number between two words in a text - RegEx

Code: Select all

text := "this 54.8 is a 51 test 88888888888.1 hehe"

RegExReplace(text, "[\d.]+", output)
msgbox, %output%
How do I get the 88888888888.1 from the text? It will have less and more digits sometimes.

Go to advanced search