• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Regex Not Working  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run a simple regex match which is not working. Would appreciate any suggestion explaining why i cannot get a match below.



i was hoping that when i will run this simple test ,it will print MATCH. But it didn't. any how i can make it work ?

I tried below variations, but none worked -



OR



OR

 
Saloon Keeper
Posts: 4051
48
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You were missing the period.

"g*" says "zero or more g's"
"g.*" says a 'g' followed by zero or more of any character.
 
john bah
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Carey Brown wrote:You were missing the period.

"g*" says "zero or more g's"
"g.*" says a 'g' followed by zero or more of any character.



thanks it worked.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!