regexp help

B

Bakes

If I were using the code:

(?P<data>[0-9]+)

to get an integer between 0 and 9, how would I allow it to register
negative integers as well?
 
P

Peter Pearson

If I were using the code:

(?P<data>[0-9]+)

to get an integer between 0 and 9, how would I allow it to register
negative integers as well?

(?P<data>-?[0-9]+)
 
P

Paul McGuire

If I were using the code:

(?P<data>[0-9]+)

to get an integer between 0 and 9, how would I allow it to register
negative integers as well?

With that + sign in there, you will actually get an integer from 0 to
99999999999999999...

-- Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,100
Members
48,773
Latest member
Kaybee

Latest Threads

Top