Questions tagged as 'regex'

1
answer

RegEx in Delphi

A help with regular expressions in Delphi 10 please. I need to check the following in string : Size ranging from a minimum of 6 characters to a maximum of 20 characters; Type of characters: a-z or A-Z or 0-9 or _ (underline character...
asked by 04.12.2017 / 15:25
1
answer

Regular Expression, taking numbers between two pre-defined texts

I need to remove números from a string . The string follows a pattern: http://www.meudominio.com/1789519-texto The number will always be between / and - I have been able to arrive at the following formul...
asked by 03.09.2015 / 19:08
2
answers

Capture text between two known characters

I need to get some text and find the words (or phrases) that are between two specific characters { and } , in this case. > I can do this by capturing the delimiters together, using the expression {(.*?)} , but I need th...
asked by 13.01.2016 / 17:57
1
answer

Roman numerals with ucwords () or ucfirst ()

While typing this question I modified some things, which made me able to solve the problem. So I'm creating this "share the knowledge" if someone has the same problem. Suppose the following names: Assassin's Creed III Problem:...
asked by 30.01.2016 / 16:57
1
answer

2 regular expressions in 1

I found the following regular expression to validate email address in javascript: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}...
asked by 22.07.2014 / 15:00
1
answer

How to replace each match instance of a regular expression with a different value?

I have text (html code) with several images in standard HTML format: <img src="X" atributos /> I need the src attribute value to be replaced with the CID: # identifier where # is a unique value that identifies each image...
asked by 27.06.2018 / 18:53
1
answer

Regular expressions, difference between [-] and -

I'm working with some regular expressions and I came across the following case: string pattern = @"^.{2,9}[-].{4}[-].{4}$"; string pattern = @"^.{2,9}-.{4}-.{4}$"; I would like to understand, what is the difference between using the hyphen...
asked by 18.12.2017 / 20:04
1
answer

REGEX of HH: MM: SS may be negative

I'm working with HH: MM: SS and I have this% REGEX ^([0-1]?\d{0,4})(?::([0-5]?\d))?(?::([0-5]?\d))?$ I'm using the library InputMask but I'd like to work with negative hours example: Effort: -200: 00: 00 Can I continue to use this...
asked by 05.01.2018 / 13:14
1
answer

Find line that starts with expression negation

I have a text file with many lines. Is it possible for me to find the first line that does not match regex ? Example, I want to make a regex that shows me the first line that does not start with BOLO BOLO BOLO CHOCOLATE I'm using...
asked by 24.08.2017 / 15:32
1
answer

Regex custom time in python 3

I need to create a regex that accepts the following entries: 8:00 8 horas 8h 8h30 (8h 30) 8h30min (8h 30 min) 8h30minutos (8h 30 minutos) And I came up with the following: ((\d{1,2}:\d{1,2}) | (\d{1,2}\s+\bhoras\b) | (\d{1,2}...
asked by 18.08.2017 / 15:24