What does it mean? = ^ Mean value in regular expression?

I want to write regexp, which allows for some special characters, such as #-., and must contain at least one letter. I also want to understand below:

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

Does this regex make sense ?=^? What is a subexpression in regexp?

+4
source share
2 answers

(?=) - this is a look, he looks forward in a row to see if he matches without capturing him.

^means that it matches the BEGINNING of the input (for example, with a string a test, ^testwill not match, since it does not start with a “test”, even if it contains it)

, , ^ $ 1-45 {1,45}, [A-Z0-9. '-] ( /i). , , , ( ).

+8

?=

+6

All Articles