Description
Javascript provides two regular function.exec():
- Goal: This method will testing the string and return the match pattern into array.
- Example:
var tabName = /#(.*)/g.exec(window.location.href)[1];
test():
- Goal: only testing the string is having the pattern and return true or false
Reference:
Chinese introduction
More detail explanation
沒有留言:
張貼留言