Quantcast
Channel: Java RegEx meta character (.) and ordinary dot? - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Atspulgs for Java RegEx meta character (.) and ordinary dot?

$
0
0

I wanted to match a string that ends with ".*" For this I had to use the following:

"^.*\\.\\*$"

Kinda silly if you think about it :D Heres what it means. At the start of the string there can be any character zero or more times followed by a dot "." followed by a star (*) at the end of the string.

I hope this comes in handy for someone. Thanks for the backslash thing to Fabian.


Viewing all articles
Browse latest Browse all 11

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>