Questions tagged as 'regex'

1
answer

Regular expression that checks for the presence of a repeating pattern

How do I make a regular expression saying that this has to repeat exactly a tot of times? For example, I would like to check if a line from a file contains this pattern |1_CHAR exactly 8 times. By now, it is possible for example to say th...
asked by 17.11.2014 / 15:58
3
answers

HTML tags with RegEx

It is as follows, using the following expression: <div class="teste">(.+?)</div> And that's the content, for example: <div class="teste">asdasdad<div>zxczxczxc</div>lkjlkjjlkj</div><div>asdasd<...
asked by 20.07.2014 / 06:18
1
answer

Obtain a string with a regular expression in JS

Well, what I need to do is get a string via input, and "get" a certain value inside such a string. Below is an example to better illustrate the situation: <iframe width="560" height="315" frameborder="0" scrolling="no" marginheight="0" marg...
asked by 03.10.2014 / 00:55
1
answer

Search Array with variable case-insensitive javascript

I need to search an array with values of type: equipamentos = [{marca: 'Nomedamarca1', modelo: 'Modelo1'}, {marca: 'Nomedamarca2', modelo: 'Modelo2'}, {marca: 'AlgumNomeComCase', modelo: 'Modelo3'},...
asked by 26.06.2018 / 17:00
1
answer

Regular expression to validate a field

I have an input on the form that should only accept the following formats: Examples 1AB 1AB2CD 1AB2CD3EF The minimum size must be 3 and maximum 9, and must always follow the pattern 1 digit and 2 letters. It should not be accepted...
asked by 05.06.2018 / 13:53
1
answer

Rule PREG MATCH appropriate

I created a loop that shows all the months of the year with the following code: for($i = 1;$i <= 12;$i++){ } Then I created a $ _GET variable that would receive a rule like the following: 1,2,3,4,5,6,7,8,9,10,11,12 This is the $ _GET...
asked by 20.11.2017 / 17:27
1
answer

Regex expression to find more than one occurrence in the same string

I'm developing a template engine in PHP for learning issues as I'm new to programming, and would like a way to find more than one #include () in my view, because the one I currently have does not find all the first.     
asked by 08.02.2018 / 11:52
1
answer

I need to select sequences of numbers in a field of a table column

I have a 'Text' column in my 'process' table. Text consists of a VARCHAR (220), in this text I need to identify a specific word pattern. In this case a sequence of numbers with a "-" to separate: '1234-567' - There are 4 digits followed by '...
asked by 05.04.2017 / 18:22
1
answer

Mask with Regex and replace to allow only digits and a single hyphen

What I need: A mask that works on the keypress event of a TextBox replacing non-numeric and excessive hyphens with "" . What is my difficulty: Check for the entry of only one hyphen in the same expression. I g...
asked by 25.08.2017 / 13:42
2
answers

How to create a regular expression to validate just a mobile number?

I made this expression, but I do not know if it is in today's patterns "/^[1-9]{2}\s?9\s?\d{8}$/"     
asked by 21.06.2017 / 18:46