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

Regex Pattern Name  RSS feed

 
Natesan Prabhakaran
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai. In my program., i want to set a name for every group in regex pattern matches..like in PERL we can achive it by
Eg:
>(?<name1>[^<]*?)<

above will print all the contents in between to tags by the name of name1. in java, how we can..
thanks...

regards
prabhu
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the current Java implementation of the regex engine, naming of groups are not supported. You have to use numbers (based on order encountered). Sorry.

BTW, why did you post this same topic 6 times?

Henry
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!