• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

pattern matching

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to retrieved the strings of a particular pattern in a string.

for example need to retrieve all the string which are between ($ ).

($ test)\ProgramFiles\($test1)

I need the values ($test) and ($test1) what is the best way to get the same,

Any help is highly appreciated.

Thanks
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're here to help, but we think the best way to help you learn is to help you do the work. So instead of just providing a solution, we want to see what you've already tried and where you're stuck.
 
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
looks to me like your are going to be passed a path to a certain file or folder.

so what you can do is use StringTokenizer and set the delimeter to '\'.

sun's API documentation is most likely the best organized and readily available API on the planet, so use it .

Justin Fox
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!