Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
What is a regEx to find a zero at the end of a string?
For instance, I want it to find the 0 in 32.20, but not the 0 in 302.2
Thank you!
If you want to match the zero in 30.1, it’s 0(?=\.|$). Else, it’s just 0$
0(?=\.|$)
0$
Add a comment
UPDATED:
The right one would be:
/0$/ or /.*0$/ if you need the whole string that ends with a zero. Here a working example on Rubular.
/0$/
/.*0$/
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.