Questions tagged as 'regex'

2
answers

How to loop with regex in javascript?

Hello everyone, how are you? I'm breaking my head on the following question: I have a string set: var teste = blabla 555.. 999 I have double white space between the digits and did the regex: var str = teste.replace(/\s{2,}/g, '.');...
asked by 09.08.2014 / 05:19
5
answers

How to change the end of a name

Changing the end of a name for example WELITON, MAICON, WELIGTON for WELITOM, MAICOM, WELIGTOM     
asked by 11.08.2016 / 00:13
1
answer

Regular expression does not validate a password when I just enter numbers

I am using this regular expression to validate my password, the password must have only letters and numbers, must have at least one letter and one number. (Minimum 8 characters). I'm using this expression: [RegularExpression(@"^[A-Za-z0-9]*...
asked by 22.10.2018 / 03:15
4
answers

Regex to pick up word between two words or "/"

Can anyone help me, I would just catch the word between resourceGroups and providers and assign it to a variable in javascript. /9c2a1079-35f0-4298-9eb3-7f63903f2ae1/resourceGroups/pegarEssaPalavra/providers/     
asked by 19.06.2018 / 23:11
1
answer

Text field formatting for PIS / PASEP

It's not really a question, it's an aid. I've been searching PIS / PASEP mask and did not find it so it was the way to implement it. I'll put the answer below. Hugs.     
asked by 08.03.2017 / 20:04
2
answers

Regex lookbehind

I need to write a regex to parse a snippet of a swift message field, so I'm using loockbehind. In the example below I have the two strings that I need from the 12 bic positions. In the first string would be TESTBIC34XXX In the second s...
asked by 09.03.2017 / 22:34
1
answer

Getting whole words with RegExp in Jquery

$.fn.wrapInTag = function(opts) { var tag = opts.tag || 'strong', words = opts.words || [], regex = RegExp(words.join('|'), 'gi'), replacement = '<' + tag + '>$&</' + tag + '>'; return...
asked by 11.12.2016 / 21:58
2
answers

Capturing string in square brackets

I need to capture strings in brackets within a string. I found a solution that did not solve my problem fully: \[(.*?)\] Usage like this: Matcher mat = Pattern.compile("\[(.*?)\]").matcher(stringlToVerify); if(mat.find()) { // Fa...
asked by 12.01.2017 / 17:02
1
answer

How does this regex work in js?

I found on the internet this regex in javascript that formats monetary values in R $: Number( 1450999 ) .toFixed( 2 ) .replace( '.', ',' ) .replace( /(\d)(?=(\d{3})+,)/g, "$1," ) // 1450999 -> 1.450.999,00 I have been analyzing for a lon...
asked by 03.11.2016 / 17:29
1
answer

How to encrypt multiple variables inside a file with php?

I'm using php to read a file for a $string , it has some variable words that I need to find and replace with others, ie I need to get these variables, encrypt them with AES and write back where they were, making a replace . The...
asked by 19.10.2016 / 06:16