.net - Regex to match word including the surrounding square brackets -
in following text, want match first [id], not second [id] part of [something].[id]
edit: actual text include square brackets. need match surrounding brackets well.
match [id] don't match [something].[id]
i used following regex, doesn't match anything.
\b\[id\]
why regex not working , what's correct one?
thanks.
as far i'm aware, \b
doesn't match beginning of string. try:
(^|[\w])\[id\]
as regex instead.
Comments
Post a Comment