java - Regex for a pattern -
i want write regex below pattern.
of john @ /roger/adam/sam
here john value(can alphanumeric) , /roger/adam/sam xpath can change.
i want replace such instances with
of $value @ $xpath
you can use following match
(of\s*)[a-za-z\d:-]+(\s*at\s*).*?(?=\s)
and replace $1$value$2$xpath
see demo
Comments
Post a Comment