I see whether the following strings match them in number 1
23_13_15_145_134_1_135 < / P>
23_13_15_145_34_1
1_23_13_15_145_3
I just want to match it properly, so the first example should not include 13, 15 or 145, only 1.
With the start and end instances of the string starting and end with 1.
Try it:
/ (^ | _) 1 ( _ | $) / Checks whether the 1 string ( ^ ) or _ It happens immediately from the beginning, and it is immediately done by another _ character, or the end of the string ( $ ). And of course, add ?: to avoid capturing for each group, if you care (and your RE engine supports it): / (?: ^ | _) 1 (?: _ | $) /
Comments
Post a Comment