Questions tagged as 'regex'

3
answers

Which regular expression can I use to remove double spaces in Javascript or PHP? [duplicate]

Which regular expression can I use to remove excess white space? I mean, leave them with the amount of standard spaces. Example From: $string = 'Estou no Stack Overflow em Português '; To: $string = 'Estou no Stack Overflow...
asked by 21.08.2015 / 18:14
4
answers

How to find hashtags in a string and store them in an array?

I have a system for posting content on a certain social network of our company. When the user enters text with hashtags , I need to detect all of them and store them in an array. Example:    Hello, I'm posting this # question to #...
asked by 19.10.2015 / 17:47
3
answers

How can I replace a part of a string by itself plus the character "~"?

How can I replace a part of a string with itself plus the "~" character? I am doing this as follows: only when the string has two equal numbers like the 51 that comes shortly after AP and the contained in 17 51 3322 Replace does...
asked by 15.06.2016 / 20:49
2
answers

How to do multiple replace using variable as first parameter?

When I want to do a replace on all occurrences of a string I do this: var ola= "ola mundo ola mundo"; ola = ola.replace(/ola/g, "xxx"); Result: "xxx world xxx world"; But I want to use a variable instead of putting the word explicit, li...
asked by 23.02.2015 / 22:04
4
answers

How to get a String that is between tags using Javascript using Regex

I have the following string: var text = "Meu nome <[email protected]>"; I would like to only get [email protected] , using Regex.     
asked by 30.01.2017 / 14:19
2
answers

Script to modify Bible texts (accessibility) [closed]

I'm not a programmer. I look for accessibility features because of my low vision. I am trying to develop a workflow that locates in the document biblical texts in the pattern "John 3:16" and transform it into "John, chapter 3, verse 16". The...
asked by 11.12.2015 / 17:14
3
answers

How to give a Regex before a string? And select?

What I need to do is this: let's assume the string is - > : . However, I want to select "only" the string before : using Regex . To get clearer: " select this word : another word here" Remembering that :...
asked by 09.01.2018 / 18:44
3
answers

How to list the results of a regex search in a directory?

I have a directory with some C # files. In these files there are several SQL query codes. I need to list all SELECT statements in these files using PowerShell. Commands start with SELECT and end with ; and can have more than one...
asked by 15.01.2014 / 15:04
4
answers

Detect Line Break

I have the following function: if (str.match(/\d\d\d\d\d\.\d\d\d\d\d/)) { var codigo_velho = str.match(/\d\d\d\d\d\.\d\d\d\d\d\/); result = "1"; } How do I change this function so that it detects line break in match ? For ex...
asked by 26.05.2014 / 04:34
2
answers

How to give split in a String that contains blanks in the beginning?

For the problem in question, I need to remove all special characters and spaces and count the possible new outputs. My intention is to separate the String with the split() method. For this, based on another expression I saw, I created thi...
asked by 20.08.2018 / 22:18