Questions tagged as 'regex'

1
answer

Working with Regular Expression

I'd like to know what is the best way to work with regular expression, so turn a code reader: Example: using System.Text.RegularExpression; void LoadRegex(string filter, RichTextBox rtb, Color c){ var RTBmatch = Regex.Matches(rtb.Text, f...
asked by 22.02.2015 / 01:59
3
answers

How to add line break using sed?

How to add a line break in a pipe-received output, using sed, only for cases that fit the established pattern? I used sed "s/.*oo.*/&\n/" to no avail. The default is OK, but the addition of the new line does not. I need to know wha...
asked by 31.07.2014 / 15:53
4
answers

Behavior of the preg_match () function for abbreviation of names

I have set up a function that gets a full name with X first names and last names and returns only the first name and last name. If you have a connective (de, da, do, etc.) before the last surname, it attaches to the result. But the preg_ma...
asked by 25.07.2014 / 17:51
2
answers

Regular expression to filter the first paragraph between tags using PHP

I need to extract the first paragraph of an HTML code using Regular Expressions. Goal: grab only highlighted content in green: HTMLCode<divclass="text"> <p><span style="font-size:16px">As notas...
asked by 06.10.2018 / 17:41
2
answers

Find a number after a specific word with grepl and regex {r}

Hello, I have a list of addresses and I am trying to check which ones have numbering and which ones do not. However, I have some strings that end with number and I'm trying to create a regex to filter those results. I do not want you to return n...
asked by 02.08.2018 / 22:23
1
answer

RegExp with only one letter

I wanted to make a RegExp that would look more or less like 0000-x , that would be available only the letter X and numbers from 0 to 9. I gave a search on the net, I was able to do with numbers only or to get all the letters . He...
asked by 14.10.2014 / 17:53
1
answer

IDE Tips / How to do?

I have the following problem I have some text that will be inserted by the user and we will take as an example Implemented phrase: I would like to know how to program better #hoje. I wanted to loop through words beginning with # a lis...
asked by 09.07.2018 / 22:35
1
answer

Replace with the same searched word with RegExr including a new character

Alright? I have a doubt. I used the expression (\ d {2}. \ D {2}) as attached image to search the codes in this list of services. I would like help Replace to occur with the same searched word plus the ; character at the beginning and end....
asked by 22.07.2018 / 22:30
1
answer

Find substring with REGEX

I'm trying to turn all N parts (...) into uppercase. I thought REGEX would be the most appropriate. But it is very difficult, nor capture the part N (...) to later convert it in capital letters I can: My file:    muffled, muffled.A + H_PRE...
asked by 30.05.2018 / 16:24
2
answers

Regex or Replace in Jquery

How do I change a string by adding new content? Example: <div><span id="number">1195555666<span><div> <script>var newNumber = $(#number).replace('(11)95555-6666')</script> console.log(newNumber); But...
asked by 20.05.2018 / 15:46