I am new to regex and am trying to break up regex to better understand it:
/(\d{3})(?=\d)/
I understand that it (\d{3})writes 3 digits, but I'm not sure what the second part is trying to capture.
(\d{3})
What does it mean ?=?
?=
(?=\d)is a positive look , it means matching and capturing 3 digits followed by a digit.
(?=\d)
So something like this will happen:
1234 => capture 123 123a => no match
(?=pat) - A positive lookahead statement: ensures that the following characters match pat, but do not include these characters in matched text
(?=pat)
/(\d{3})(?=\d)/ - (\d{3}) 3 , , .
,
, !
Source: https://habr.com/ru/post/1524244/More articles:How to subtract two images using python opencv2 to get a foreground object - pythonImageView масштабируется до фиксированной высоты, но избыточная ширина урожая - androidПроверьте, действительно ли работает буфер перехода (не локальные переходы) - c++Further localize memory leak with memwatch - node.jsHow to protect the source code of a chrome-packaged application? - javascriptDeletions are not allowed unless they contain a where clause or a like clause - phpPDF Print Programmatically - androidWhat is the C # language property that makes reflection possible? - reflectionto avoid asynchrony of the update fragment when changing the screen orientation - androidWhich package should I use to connect R with MongoDB? - rAll Articles