Basic Math Regex

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
2lucene7
Noob
Noob
Posts: 4
Joined: 01 Jan 2017, 23:59
Noob?: No

Basic Math Regex

#1 Post by 2lucene7 »

This was a while ago and I was wondering if someone could help me with a regex if someone asks to do some basic math such as add, subtract, multiply and divide.

Code: Select all

automacro OnePlusOne {
	pubm /(\d+)(\+|-|/|\*)(\d+)/i
	call {
		do c <something>
	}
}

User avatar
SkylorD
Moderators
Moderators
Posts: 1167
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: Basic Math Regex

#2 Post by SkylorD »

On division u should use The "escape".
\/

Cause we have this

/abcd/

And if u dont use this we can close The expression before The time.
Learn rules

Locked