regex: how to stop on no alpha or end of line char? -
my goal match both:
25 place de la paix 24 place de la guerre. not continue after . 26 place de la foi !do not continue after !
should give 3 results:
25 place de la paix 24 place de la guerre 26 place de la foi
i use:
/\d+\splace.*[^a-z\s]/iu
which works fine
24 place de la guerre.
since stopps @ none alpha numeric char "."
i stop regex on no alpha or @ end of line char: idea ?
i tried
/\d+\splace.*[^a-z\s\n]/iu /\d+\splace.*[^a-z\s\r]/iu
you don't need use .*
after place
. can use [a-z\s]*
match want:
/\b\d+\s+place[a-z\s]*/i
or else use negative lookahead
stop when encounter first non-letter, non-space character:
/\b\d+\s+place.*?(?=[^a-z\s]|$)/mi
Comments
Post a Comment