Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regex for hard coded string  RSS feed

 
sahid ul karim
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me what is the regex for searching hard coded string in a file.
Pattern pattern = Pattern.compile(regex);
what wld be the regex?
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sahid ul karim:
Pattern pattern = Pattern.compile(regex);
what wld be the regex?


Refer to Java Doc Pattern.compile(regex)
 
sahid ul karim
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not that exact answer i am looking for.I am not able to construct the pattern in java.Can anybody help me out?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to construct the pattern in java.


What does that mean? What are you doing now, and how is or isn't it working? TellTheDetails

If it's a string you're searching, it might be easier to use the String.indexOf method.
[ September 10, 2007: Message edited by: Ulf Dittmer ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!