N
N
Nikita2016-05-07 20:00:16
Regular Expressions
Nikita, 2016-05-07 20:00:16

How to extract letters from a string?

I have a sample string:
string str = "0.005 кв.м";
I need to get "sq.m" from it, but I don't understand how to do it in C#. There are no problems with the numbers, they can be obtained from the sample with such a template:

string pattern = @"\b((\d+\,\d+)|(\d+\.\d+)|(\d+))";

Tell me how to do it with letters, with [:alpha:] something doesn’t work for me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pavlyuk, 2016-05-07
@Smiz001

\S+$
https://regex101.com/r/fK9kF5/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question