Jump to content

Recommended Posts

Posted

Bhayya okka document lo text ela vundhi [[abc]] so adhi findout chesi replace with abc , eppudu ala okka 10 places lo vundhi with different values so i used 

replace(Pattern.compile("/[/[(.*?)/]/]"))

 

kani ee pattern.compile pani chesthaledhu to find out the text.... so aa pattern ne find out cheyale ante ela chesthamu ?

Posted

try with backslash Pattern.compile("\[\[(.*?)\]\]")

 

it won't compile bcz of escape chars

 

so

 

Pattern.compile("\\[\\[(.*?)\\]\\]") will work

Posted

Bhayya appudu adhi ela print avuthundhi \[\[(.*?)\]\]

 

try with backslash Pattern.compile("\[\[(.*?)\]\]")

 

it won't compile bcz of escape chars

 

so

 

Pattern.compile("\\[\\[(.*?)\\]\\]") will work

 

×
×
  • Create New...