0

I have tried the code given on this question (?<![-.])\b[0-9]+\b(?!\.[0-9]), but flex shows: Bad Character: <
Bad Character: !
Bad Character: [
...

Community
  • 1
  • 1
rneha725
  • 475
  • 4
  • 12
  • Always suspect that lookarounds aren't supported when you get an error like that ! –  Jul 07 '15 at 23:29

2 Answers2

0

I'm not familiar with Flex but from a rapid google search, it appears that flex uses < and > characters for match tokens. Try escaping these characters with a back slash and see if that helps.

<\<

Jason L.
  • 1,125
  • 11
  • 19
  • thanks Jason but I have already tried that, in addition it shows `Bad Character: \\` – rneha725 Jul 07 '15 at 21:04
  • 1
    In some languages like C#, `(?<` has a special function within the context of a regex. In C#s case, it "captures the matched subexpression into a named group", such as `(?< name > subexpression)`. It's possible that the regex implementation of Flex has a similar construct that would make this regex be considered invalid. – Jason L. Jul 07 '15 at 21:22
0

Sorry all, but according to this answer flex doesn't support lookahead. I think I should take this question down.

Community
  • 1
  • 1
rneha725
  • 475
  • 4
  • 12