|
|||
|
Scopas says:
Quote:
|
|
|||
|
Scopas says:
Quote:
|
|
|||
|
Scopas says:
Quote:
|
|
|||
|
Scopas says:
Quote:
|
|
|||
|
When you use the global flag 'g', the "lastIndex" property is changed. It's a global property that specifies the position at which to start the next match.
You can do like this: Code:
r = /[ \w]+/i; k = /[ \w]+/i; s = "ab bdabbc abdaBa"; p = "abbd abbcab daBaryjry"; trace(r.exec(s)); trace(k.exec(p)); Code:
r = /[ \w]+/gi; k = /[ \w]+/gi; s = "ab bdabbc abdaBa"; p = "abbd abbcab daBaryjry"; trace(r.exec(s)); k.lastIndex = 0; trace(k.exec(p)); |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|