Questions tagged as 'regex'

3
answers

Catch only the values before the "=" character using regular expression?

I have a file containing the following content: Maringa=123123 Marialva=789789 Mandaguacu=123456 Cidadex=A341a2 How do I get only the characters before = , using regular expression? I tried it like this: .*= But the String c...
asked by 13.12.2013 / 17:46
4
answers

How to select a text snippet in a String?

I'm creating a text file and using some delimiters ( <# and #> ) I need to select what's inside the <# texto.delimitado #> delimiter. Using the split() JavaScript function. What would be the best regular...
asked by 30.12.2013 / 04:43
2
answers

How to create regexReplace for a delimiter?

I have the following content: 123|321|1234\|56\|teste\||123 I would like to make a regex replace that would replace all | with line break and ignore | escaped with \ , so I would like to get the following return:...
asked by 21.01.2014 / 12:08
1
answer

How to set TitleCase using regex in Javascript?

I have this function: var titleCase = function(s) { return s.replace(/(\w)(\w*)/g, function(g0, g1, g2) { return g1.toUpperCase() + g2.toLowerCase(); }); } If I call her by passing something she works ri...
asked by 28.04.2014 / 19:45
1
answer

Regular expression and template are not working

I'm trying to create a template engine using JavaScript. The syntax will be more or less similar to that of Laravel (blade), with some modifications. I'm part of creating expressions. The first one I'm doing is if , but right away I've...
asked by 21.03.2018 / 18:00
4
answers

How to capture textarea tag with new line?

How to get the values of a <textarea> with Regex, including new line? I have the following expression to get a textarea : ([<]textarea.*[<\/textarea][>]) Example online. The problem is that if textarea...
asked by 02.08.2016 / 17:39
2
answers

Find Element tr of a certain content

I'd like to know how to find a particular <tr> element in a numbered table. For example: In a table where each <tr> line has its <td> cells numbered 1-5, containing 4 lines <tr> , if I pass the...
asked by 30.03.2015 / 17:09
2
answers

How to count the amount of occurrence of a substring within a string?

I have the following return:    EXCEPTION, ClassException, EXCEPTION, Exception Message I'd like to get the number of times the String EXCEPTION appears using Regex . I used the following code: Pattern.compile("(EXCEPTION)",Pa...
asked by 16.01.2014 / 13:47
4
answers

Regex - Get text up to a certain string

I would like to get the text up to the characters a) and if possible and the replies also separated using Regex? pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergunta pergun...
asked by 28.11.2017 / 20:05
3
answers

How is a REGEX Javascript for Tracking Code Posts (AZ123456789AZ)

I need a Regex for the default A-Z 1-9 A-Z validating AZ123456789AZ I've tried /^[[A-Z]{2}[1-9]{9}[A-Z]{2}]/$     
asked by 20.09.2018 / 20:06