2010-04-03 14:39:32 +00:00
|
|
|
# Regular expression literals.
|
2010-02-27 19:30:14 +00:00
|
|
|
ok 'x'.match(/x/g)
|
|
|
|
ok 'x'.match /x/g
|
|
|
|
ok 'x'.match(/x/)
|
|
|
|
ok 'x'.match /x/
|
|
|
|
|
|
|
|
ok 4 / 2 / 1 is 2
|
|
|
|
|
|
|
|
y: 4
|
|
|
|
x: 2
|
|
|
|
g: 1
|
|
|
|
|
2010-03-09 03:25:06 +00:00
|
|
|
ok y / x/g is 2
|
|
|
|
|
2010-05-14 13:14:41 +00:00
|
|
|
ok 'http://google.com'.match(/:\/\/goog/)
|
|
|
|
|
|
|
|
obj: {
|
|
|
|
width: -> 10
|
|
|
|
height: -> 20
|
|
|
|
}
|
|
|
|
id: 2
|
|
|
|
|
|
|
|
ok (obj.width()/id - obj.height()/id) is -5
|