regex - Java Regular Expression repeated group capture -
i getting problem capturing repeated group here, can help?
string : ushinski k. d. (konstantin dmitrievich)
the regex i'm using :
(?i)(.*)((?:[a-z]{1,2}\.\s)+)\(.* but capturing "ushinski k. " group 1 , "d. " group 2. target capture "ushinski " group 1 , "k. d. " group 2. highly appreciated.
you have use (.*?) or can use word boundaries (\b.*\b) instead of (.*) take @ post what difference between regex (.*?) , (.*)?
(?i)(.*?)\s((?:[a-z]{1,2}\.\s)+)\(.* or
(?i)(\b.*\b)\s((?:[a-z]{1,2}\.\s)+)\(.*
Comments
Post a Comment