javascript - What does ?=^ mean in a regexp? -


i want write regexp allows special characters #-. , should contain @ least 1 letter. want understand below things also:

/(?=^[a-z0-9. '-]{1,45}$)/i 

in regexp meaning of ?=^ ? subexpression in regexp?

(?=) lookahead, it's looking ahead in string see if matches without capturing it

^ means matches @ beginning of input (for example string a test, ^test not match doesn't start "test" though contains it)

overall, expression saying has ^ start , $ end 1-45 {1,45} items exist in character group [a-z0-9. '-] (case insensitive /i). fact within lookahead in case means it's not going capture (zero-length match).


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -