Flex 3 Regular Expression Problem

Posted by Tommy on Stack Overflow See other posts from Stack Overflow or by Tommy
Published on 2010-03-11T18:43:46Z Indexed on 2010/03/11 18:59 UTC
Read the original article Hit count: 270

Filed under:
|
|

I've written a url validator for a project I am working on. For my requirements it works great, except when the last part for the url goes longer than 22 characters it breaks. My expression:

/((https?):\/\/)([^\s.]+.)+([^\s.]+)(:\d+\/\S+)/i

It expects input that looks like "http(s)://hostname:port/location". When I give it the input:

https://demo10:443/111112222233333444445

it works, but if I pass the input

https://demo10:443/1111122222333334444455

it breaks. You can test it out easily at http://ryanswanson.com/regexp/#start. Oddly, I can't reproduce the problem with just the relevant (I would think) part /(:\d+\/\S+)/i. I can have as many characters after the required / and it works great. Any ideas or known bugs?

© Stack Overflow or respective owner

Related posts about flex

Related posts about regex