Questions tagged as 'regex'

3
answers

Regex capturing exactly x digits of a string

I'm trying to make a regular expression where it exactly captures x digits (specifically in my case x = 6). Example: "test 1 n ° 123456 end of test" "test 2 n ° 7890123 end of test" I want to return only the "123456" in the regular exp...
asked by 19.12.2018 / 22:38
3
answers

Help with Regex

Before asking I looked for several references, but I still do not understand much and managed to reach only to a certain extent. My goal is to validate that a specific string has 10 characters, the first two letters being uppercase, an...
asked by 27.01.2016 / 14:06
2
answers

Regex to find occurrences of one word before the other

I need to find in the system fonts situations where TAction occurs after TdxBar . This will happen on different lines, but within the same file. for example pnlVisao: TPanel; tbToolBar: TdxBar; btnCancelar: TButton; actAbrir: TAction;...
asked by 12.03.2015 / 15:10
4
answers

Decrease field value span with preg_replace

I'm trying to change all the values of fields containing span class . Example the site looks like this: <div id="isOffered"> <a class="price addBetButton footballBetButton" id="bk_82285689_mk_sel1" href=""> <span...
asked by 23.02.2015 / 01:56
3
answers

Remove spaces from a string from the second occurrence

I'm currently removing spaces using a simple replace() and adding a space that I must preserve between the third and fourth character using substr() let str = 'abc defghijk lmnop qrstuv wx y z' str = str.replace(/\s+/g, ''...
asked by 27.07.2018 / 16:34
3
answers

Sort phone numbers in a string

I have some mobile numbers, fixed and fixed, in a database, I used the function implode() to join them in the same string, getting like this: (11) 3333-4353 (11) 98000-2222 (11) 3027-5555 (11) 97000-0333 What I want to do is sort th...
asked by 11.06.2017 / 23:17
4
answers

Regex for Site Cifras as CifraClub

I need a Regex that works fine, and in JS, to get only the chords of a cipher like this: link The problem is that I never mess with Regex. Any ideas?     
asked by 14.01.2014 / 01:56
2
answers

Remove String Connectors with Regular Expression

How could I remove connectors: "and", "do", "of", "of", "of", "of", "di", "du". One sentence without changing the whole name. Example name: Daniela de Andrade. I want to remove only "from", without removing the "DA" from andra "FROM" I am usi...
asked by 23.11.2014 / 23:20
3
answers

Best way to apply a pattern to the acronym

I have the following possible returns: AB A1 A The first will always be a letter, the second may or may not occur and may be letter or number. In JavaScript it's like this (Example): if (/^[A-Z][\w]$/.test(value.toUpperCase())) {...
asked by 18.09.2018 / 21:54
2
answers

Doubt, regular expression in java

I have the following regular expressions. The first valid words and you're right. The problem is in the second that is to validate directory, such as " home/PauloNeto/NetBeansProjects/Expre/src/expre/texto.txt ". I can not get her to valid...
asked by 08.11.2015 / 20:34