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

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

python - Exception while importing pymorphy2 -