First off, let's start with its non-past affirmative form: kagiru 限る. It means "to limit (something) (to something else)," and has really no trick in using it.
- jippun ni kagiru 十分に限る
Limit [it] to 10 minutes.
- ningen ni kagitteiru 人間に限っている
Limited to humans. (not animals, plants, etc.)
The problem is: you almost never see this verb used like the above. Its derived words kagiri and kagiranai are used with a lot more of frequency, and those ones are trickier to get.
Kagiri 限りThe word kagiri basically means "as long as (what's before) (what's after)." Let's see some example:
- idou suru kagiri kateru 移動する限り勝てる
As long as [we] move [we] can win.
- idou shinai kagiri kateru 移動しない限り勝てる
As long as [we] do not move [we] can win.
- idou shinai kagiri katenai 移動しない限り勝てない
As long as [we] do not move [we] can not win.
- idou suru kagiri katenai 移動する限り勝てない
As long as [we] move [we] can not win.
Remembering that [we] may be different from context. For example, idou suru kagiri katenai is more likely to be "as long as [he's] moving [we] can't win."
The meaning of the word kagiranai 限らない is somewhat related to kagiri 限り, except it's in negative and works in a different way. It often means that "(something) is not guaranteed" or something else may happen. This usually happens when a sentence ends in to wa kagiranai とは限らない.
- sou wa kagiranai そうは限らない
It isn't limited to that.
It may not be just that.
Something else may happen.
- kachi to wa kagiranee 勝ちとは限らねえー
Victory ain't guaranteed.
- aitsu ga kuru to wa kagiranai あいつが来るとは限らない
It isn't guaranteed he'll come.
- onaji kekka ga matsu to wa kagiranai 同じ結果が待つとは限らない
The same result may not be waiting.
You may not get the same results.