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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -