Well, I have a tree structure in database in which each node has its own
unique id as above, say 1.1.1.2.1 now by given a node and its position (the
same id) I have to extract all its parents and return back to the client.
the parents' ids are identified by that unique id (1, 1.1, 1.1.1 AND
1.1.1.2) if it was only one node there was no problem using a for loop but
we may have hundreds of these nodes and should extract all of them each for
a user concurrently and this is a performance issue
now I am welcome if you can help me on this with anything better than Regex
thanks
Peter Boughton wrote:
>
>> Thanks Adrian, No actually I am using Java Regex but I think they are
>> alike.
>> I want not to use any for loop
>
> Why not?
>
> Can you provide more context as to what you're actually doing? It
> might enable a better answer.
>
>
> You can do:
> ^\d for 1
> ^\d(\.\d){1} for 1.1
> ^\d(\.\d){2} for 1.1.2
> ^\d(\.\d){3} for 1.1.2.1
> etc
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive: http://www.houseoffusion.com/groups/regex/message.cfm/messageid:1194
Subscription: http://www.houseoffusion.com/groups/regex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21