Questions tagged as 'regex'

1
answer

Regex not to escape only =?

I currently have the following regex: "/([^\w\.\,]+\s*)/" It escapes, letters, numbers, commas and points followed or not of space. How do I let it escape all except the characters: < > = !     
asked by 27.12.2015 / 16:30
1
answer

Regex - Get formatting with no strings around [duplicate]

I'm trying to make a regex to get slack formatting. Eg: *a* = > Take to make bold An initial regex I made was: /\*(.*?)\*/g The problem: Can not have anything around the string (No characters stuck before or after)...
asked by 11.12.2018 / 20:18
1
answer

Why does not the Matcher class return the number of groups correctly?

After the question " What is the difference of use between match () and find () methods of Matcher class? ", I continued testing this class to understand its operation, but I came across a strange behavior. When trying to identify the number...
asked by 03.10.2017 / 01:08
1
answer

Mask Accounting plan in javascript [closed]

How can I make a function in javascript to format the values entered in an input to the standard chart of accounts chart similar to the one below. 1 (min) 1.1 1.1.1 1.1.1.01 1.1.1.01.001 (max) Column Account     
asked by 09.03.2018 / 03:06
2
answers

Help with regex in Java - sequence of numbers separated by commas

I'm breaking my head to put together a regular expression that validates the String: /aluno/1/Teste dos Testes/1,2,3 String reg = "/aluno/[0-9]+/[^0-9]+/......." I'm not able to validate the last field (the sequence of numbers)...
asked by 22.04.2018 / 03:15
3
answers

Regex in javascript to match partial URL

I need to write a javascript regex that contains a specific piece of URL, but I'm not able to do it, mainly because it's a url with "/". Example: Any "like" or partial match for "www.url.com/foo" www.url.com/foo/bar/send/123 - true www.url...
asked by 22.03.2017 / 14:54
1
answer

Remove number sequence of string

I have the following problem, I believe I can solve it with regular expressions, but I'm bad with it. Let's say I have a string like this: CONECTOR BNC FEMEA + F MACHO 024267 or so PLUG P-4 UNIVERSAL 006-096 , the position of the...
asked by 13.02.2017 / 12:14
3
answers

Regular expression for e-mail in C ++

I have the following regular expression in a format validation function in C ++ using regex, but it is validating non-standard formats that I want.    b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}b\.[A-Z]{2,4}b Email: [email protected]...
asked by 08.02.2017 / 03:20
2
answers

Regular expression in JavaScript to validate username size

I need a JavaScript regular expression that meets the following rules: Have between 2 and 255 characters In lower case Only contain alphanumeric, underline (_), period (.) or hyphen (-).
asked by 11.01.2017 / 18:55
1
answer

Regex, valid if there are specific words in any order

For me it is always better to exemplify regex cases. See: Word1 - Valid Word2 - Valid Word1 Word2 - Valid Word2 Word1 - Valid Word1 Word1 - Invalid Word2 Word2 - Invalid But let's say 5 or 6 words, it is very...
asked by 30.04.2016 / 20:47