Questions tagged as 'regex'

4
answers

Doubts with RegEx with new line

I created the following expression: "<strike>.*?</strike>" To get all the text taxed, but due to the source code having a line break (as in the example below) is not working. <p style="margin-top: 0; margin-bottom: 0">&...
asked by 11.02.2014 / 17:57
2
answers

Regular expressions: lazy function "?"

I've learned about using Regular Expressions and read some explanations about using the ? sign (called lazy ), such as # :    *? : Matches the previous element zero times or more, but as few as possible. In RegExr shows me...
asked by 19.06.2018 / 00:24
1
answer

Why does the RegEx result have two values?

I need kb, mb or gb patterns, I'm using the regular expression (k|m|g)b$ and it has to be at the end of the line. test my expression results in only 1 match when testing "20kb", but in this script the array has 2 positions. Why doe...
asked by 24.04.2015 / 20:35
2
answers

How to get a loose number in my HTML?

Consider the following code: <span class="test"><span style="color:green">Teste</span>:</span> Text<br><br> <span class="test"><span style="color:green">Mais</span>:</span> Text<br...
asked by 22.04.2014 / 00:49
2
answers

How to correctly use Regular Expression

I'm studying about RegularExpression , but I'm not getting it right. In my Model the property CPF must be filled only by numbers: [RegularExpression(@"[0-9]", ErrorMessage = "CPF deve conter apenas números")] public string...
asked by 25.11.2015 / 16:59
2
answers

Do not need to escape the "." in a field [...] in REGEX?

I was seeing some regular expressions here on the network, and I noticed that in many, in the character field, . was not escaped \. . Thus: [a-zA-Z0-9.] . It does not need the \ character before, does it?     
asked by 28.11.2015 / 03:59
3
answers

Find quotation marks with whitespace with RegEx

I need to find errors where inside quotation marks have spaces at the beginning or end of them. Examples of errors: The news was given by "Jornal do Brasil". Paris is considered the "City of Light". Note that in the first case, insid...
asked by 26.08.2014 / 22:37
6
answers

Remove an undetermined number of "\" in a column in the database

The description field in the product table contains HTML generated by CKEditor (English) to escape content: <table cellpadding=\"\&quot;\\&quot;\\\\&quot;\\\\\\\\&quot;\\\\\\\\\\\\\\\\&quot;\\\\\\\\\\\\...
asked by 29.01.2014 / 13:37
1
answer

How to know the number of possible occurrences found by the group () method of the Matcher class?

After the question " Why did the Matcher class not return the number of groups correctly? , it was explained that the groupCount() method actually returns the number of filter groups in the regular expression, and in question" a href="htt...
asked by 03.10.2017 / 03:44
3
answers

REGEX - search for expressions that do NOT contain specific words

We are using REGEX to normalize pharmaceutical data from a string field and we need to distinguish very similar strings from an exception command. For example, in a very simple way, we have the following records: 0.5 MG COM CT BL AL / AL...
asked by 26.07.2016 / 13:30