Questions tagged as 'regex'

1
answer

Regular expression to recognize language: words that do not contain "bbab"

@LINQ challenged me to write a regular expression to recognize the following language L : I was able to build on this premise the following finite state machine:    Miguel Angelo has detected a typing error in the AFD...
asked by 28.09.2017 / 03:20
5
answers

How to make a regular expression for cell phone?

How to create a regular expression to validate the phone field that accepts 99-99999999 (DDD + 8 numbers) or 99-999999999 (DDD + 9 numbers). And when typing it add the - dash automatically! ValidationExpression="^[0-9]{2}-([0-9]{8}|[0-9]{9})...
asked by 13.01.2015 / 13:23
2
answers

Meaning of?:? =?! ? =?! in a regex

In several regex I noticed some symbols that do not seem to be part of the catch but some kind of functionality. I would like to know the name or term of these symbols and what is the functionality of each one. ?: ?= ?! ?<= ?<!     
asked by 22.04.2014 / 16:06
1
answer

Do replacing strings with Regex slow down than replace?

Let's say I wanted to do something like this question How to convert CamelCase to snake_case in C #? Convert CamelCase to snake_case in C # You had some answers, but I want to highlight these two. Answer 1 string stringSnake =...
asked by 04.07.2016 / 19:10
1
answer

What does the shortcut \ s mean in REGEX?

This is an intentional question, because I see many people using \s in regex thinking their meaning is ' ' (space) because I tell them, it is not, at least not only that.    But what does \s mean in REGEX?     
asked by 29.01.2016 / 14:05
3
answers

How to delete duplicate spaces in a string?

I have the following string : var str = "00000.00000 111111111.111111111111 33333333" I need to remove the extra spaces for it to be like this (only with 1 space): var str = "00000.00000 111111111.111111111111 33333333" How do I pro...
asked by 25.05.2014 / 02:14
3
answers

How to find a String from Regular Expressions

I have a field in the SQL Server 2014 database that stores the client address. The problem is that everything was stored in a single varchar field. Here are some real examples:    Antonio José Nerchis Street, 81    Street: Guaira /...
asked by 31.08.2016 / 20:09
1
answer

What is a boundary (b) in a regular expression?

A long time ago, I took a look at using boundary , studying about regular expressions in PHP (PCRE Patterns). I came across the \b (which is called boundary). How useful is it in a regular expression?     
asked by 30.01.2016 / 20:12
2
answers

Sort ListT using regex

I have a List of directories that is sorted by name: List<DirectoryInfo> dirs = parentdir.GetDirectories().OrderBy(c => c.Name).ToList(); The problem is that I have folders whose names are numbers separated by periods (as if...
asked by 10.04.2015 / 19:43
3
answers

What is the difference between the match () and find () methods of the Matcher class?

I'm trying to understand the difference in use of these two class methods Matcher , but I could not quite understand the description of the documentation that says:    public boolean matches ()   Attempts to match the entire region agains...
asked by 02.10.2017 / 14:32