This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • 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: 4357
50
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.
 
get schwifty. tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!