Ragen Dazs
Ragen Dazs

Reputation: 2170

Regex exclude criteria

After some tries I have created the follow regex:

/([^\w][[:alnum:]]*\.)/g

That matches results as this image:

enter image description here

In the secod case, pointed by red arrow I got "=U." as match, but I only want "U." (rather if without spaces before) and "A2." - how can I exclude "=" (equal) char from match criteria?

See the live example: http://regex101.com/r/cI9fL1

Upvotes: 0

Views: 302

Answers (1)

amon
amon

Reputation: 57646

You probably want to use a lookbehind:

/(?<=\W)([[:alnum:]]*\.)/

Upvotes: 1

Related Questions