Похожие чаты

Hey guys, would love your help correcting my regex. I would

like the match to NOT include whitespaces, or any other characters prior to the matched digits.

My current expression:
/(?<=temp)(?:.*?)-?\d+\.?\d*/gm
Example string:
temp 50 ec 20 hum 100 20 temp /unwantedstuff/ 50.50 temp -50.25
Expected output:
50
50.50
-50.25

Thanks!

8 ответов

15 просмотров

Is the location for each word fixed each time with only space as separator?

Barkuni- Автор вопроса
Sharuzzaman Ahmat Raslan
Is the location for each word fixed each time with...

no, the separator can be anything, I'm looking for the digits closest to the specified string (temp in this case), without including what's between.

Barkuni
no, the separator can be anything, I'm looking for...

Does not make sense separator can be anything. Show the real line in pastebin

Barkuni- Автор вопроса
Sharuzzaman Ahmat Raslan
Does not make sense separator can be anything. Sho...

Thanks for attempting to help, I'm not sure what you are unclear about, but no worries, I'm progressing with a pseudo solution for now.

Use negative lookbehind

Or just check that the string starts with a digit (^\d+)

Slightly modified version of the expression I found here, which was the first result to come up when I typed "match float regex" into Google.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта