Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
integer regular expressions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-03-30 (17:19)
From: Florent.Ouchet@i...
Subject: integer regular expressions

I'm looking for a way to match integer numbers (immediate values),  
whose types may be either int, int32, int64 or big_int. A conversion  
to string in order to use string (perl compatible) regular expressions  
is likely not the solution I'm looking for because it will not allow  
integer specific matches.

For instance (not normative), the regular expression syntax and  
semantics would allow complex matches such as "0%30" === "this integer  
matches if and only if its modulo to 30 is equal to 0". As in string  
regular expressions, operator | will implement a logical or...

I googled a little but all the results are always related to string  
regular expressions :( any pointers? any existing Caml code?


Florent Ouchet