How can I select every a in a text, but not adjacent a's appearing before it. For example all bold a from the string below
a bcda bbba bxyaaa aaa abbb baaaabazsrbbaba baaaa
With this regex /[a]+/g, it select all occurrence of 'a'
Thank you.
How can I select every a in a text, but not adjacent a's appearing before it. For example all bold a from the string below
a bcda bbba bxyaaa aaa abbb baaaabazsrbbaba baaaa
With this regex /[a]+/g, it select all occurrence of 'a'
Thank you.
Last edited by tsarma; 02/19/2019 at 10:39.
OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world
try this:
/(a{1})(?!\1)/g
explanation:
(a{1}) exactly a single "a"
(?!\1) which isn't followed by the exact same match (\1 reference to the first match)
Consulenza Contao CMS https://www.intco.it
Thank you very much, yours solution seems working. I've here a test link
https://regex101.com/r/hb02dk/1
OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world
Bookmarks