-1

Im using validates_format_of method to check a input text Javascript cant read this regex. How or where I can change this regex to be as original:

(?<=^|,|\b)[1-7](?=$|,|\b)

Thanks

UPDATE: the input text must be one o more digits separated by comma, ex: 1|1,2|1,2,3

1 Answers1

0

As @wiktor said you should use

\b[1-7]\b

As \b only asserts positions, you don't need to worry about matching more than [1-7].

@Code Maniac correctly stated that look behind is not supported in Mozilla and many others, so about it. see

YOGO
  • 531
  • 4
  • 5