Error - Dangling meta character '*' near index 0

From past 20 mins I am trying to fix this problem but failed. ):

I have a String "106*151*154*145*40*145*156*143*157*144*145*162*41"

I am trying to replace the segment *1 res.replaceAll(seg, "A"); but get the error

Dangling meta character '*' near index 0 *1

Other replacements run but not this. :frowning_face:

Please help ,me

https://www.yawintutor.com/java-util-regex-patternsyntaxexception-dangling-meta-character-near-index-0/

1 Like

Thanks that worked! I should have searched before posting.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.