This was what was wanted,
----------------------------------------
// The rules below have been inspired from
//
http://svn.fifesoft.com/viewvc-1.0.5/bin/cgi/viewvc.cgi/RSyntaxTextArea/trunk/src/org/fife/ui/rsyntaxtextarea/modes/CTokenMaker.flex?logsort=cvs&view=markup&root=RSyntaxTextArea&pathrev=12
letter = [A-Za-z]
letter_or_underscore = ({letter}|[_])
digit = [0-9]
url_gen_delim = ([:\/\?#\[\]@])
url_sub_delim = ([\!\$&'\(\)\*\+,;=])
url_unreserved = ({letter_or_underscore}|{digit}|[\-\.\~])
url_character = ({url_gen_delim}|{url_sub_delim}|{url_unreserved}|[%])
url_characters = ({url_character}*)
url_end_character = ([\/\$]|{letter}|{digit})
dec_uri =
(((https?|f(tp|ile))"://"|"www.")({url_characters}{url_end_character})?)
----------------------------------------
HTH,
Ravi
Quoting Steve Rowe <sa...@od...> on 04/26/2011
> Hi PCoder,
>
> JFlex doesn't support {n,} syntax. From the manual
> <http://jflex.de/manual.html>:
>
> a{n}
>
> ...
>
> a{n,m}
>
> ...
>
> (no "a{n,}" here)
>
> The following (untested) should work:
>
> dec_uri = [a-zA-Z]{3}[a-zA-Z]*://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
>
> Your sub-expression "(/[\w- ./?%&=]*)?" appears to contain a space,
> which is very likely not what you want.
>
> Steve
>
> On 4/24/2011 10:58 AM, Purple Coder wrote:
>> Hi,
>>
>> I am trying hard to get my regular expression into my flex file (for
>> grabbing the URIs in my input). JFlex doesn;t seem to like
>> characters like {} and / in my regular expression.
>>
>> dec_uri = ([a-zA-Z]{3,})://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
>>
>> I am using the above line in my flex file. And flex doesn;t seem to
>> like { in the above expression. The output is:
>>
>> Error in file "rql.flex" (line 72):
>> Syntax error.
>>
>> dec_uri = ([a-zA-Z]'{'3,'}'):'/''/'([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
>>
>> ^
>>
>>
>> Error in file "rql.flex" (line 72):
>> Unexpected character
>>
>> dec_uri = ([a-zA-Z]'{'3,'}'):'/''/'([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
>>
>>
>> I would appreciate if someone could help me with this. I don't find
>> sufficient information in the documentation.
>>
>> Thank you,
>> PCoder
>>
>>
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network
>> management toolset available today. Delivers lowest initial
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd
>>
>>
>> --
>> jflex-users mailing list
>> https://lists.sourceforge.net/lists/listinfo/jflex-users
>
>
|