# Hey to all - a regex Q

eliran mic

Greenhorn

Posts: 1

posted 4 years ago

- 0

I'm programming for university project a scientific calculator

I'm trying to find expression in the middle of the line input with square brackets

The regax looks like this

"[([)][*]+[(])]"

But when I enter the command

int startIndex = match.regionStart ();

int endIndex = match.regionEnd ();

I get the index of the beginning of the string and the end instead where brackets Location

(Input can show that 3 + [4 * 5] or more complex expression)

For input 3 + [4 * 5]

startIndex will be 0

endIndex will be 11

What am I doing wrong???

Thanks in advance

Eliran

I'm trying to find expression in the middle of the line input with square brackets

The regax looks like this

"[([)][*]+[(])]"

But when I enter the command

int startIndex = match.regionStart ();

int endIndex = match.regionEnd ();

I get the index of the beginning of the string and the end instead where brackets Location

(Input can show that 3 + [4 * 5] or more complex expression)

For input 3 + [4 * 5]

startIndex will be 0

endIndex will be 11

What am I doing wrong???

Thanks in advance

Eliran

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |