Questions tagged as 'regex'

1
answer

Validate CPF with JavaScript Regular Expression

Well, I'm trying to validate CPF with regular expressions only. I have already been able to validate the format ... 000.000.000-10 ^([0-9]){3}\.([0-9]){3}\.([0-9]){3}-([0-9]){2}$ Now, is there a way to validate if the CPF is valid in relati...
asked by 16.04.2016 / 07:00
2
answers

Get URL with regular expression links

I'm trying to extract only the URL if an expression is validated with the [monitory] tag. The expression I use is this: (?=<a.*\[monitory\].*href=["|'][http:|https:]?[\/\/]).*?["|']> And for example on a link like this: &l...
asked by 16.11.2018 / 00:32
2
answers

Using REGEX in PHP to capture any number that is not within single quotes

I have been studying regex for some time and now I have a problem: Capturing all numbers, including decimals, that are not within single quotation marks . I'm creating a sort of viewer for PHP code to learn how to use regex better. I have...
asked by 19.12.2018 / 17:09
3
answers

How to 'break' a text at each character range - Javascript

I would like to know how to 'break' (split function) one text every 8 characters in javascript for example: var teste = '1234567898' teste.split({a cada 8 caracteres}) //retorna ['12345678', '898']; Thank you in advance.     
asked by 18.12.2014 / 19:57
1
answer

Validate credit card with js

I would like to know how to validate the credit card through Js. Visa starts with 4 Mastercard starts with 51, 52, 53, 54 or 55; American Express starts with 34 and 37 Does anyone know how to validate this? <fieldset class="fsRe...
asked by 25.10.2015 / 17:28
2
answers

Regular expression for password

I'm trying to do a strong password check in javascript. Initially I want to check if there are 02 numbers in the string under the following conditions: "12vvv": two consecutive numbers or more of anything returning true "1a1a": two separat...
asked by 22.02.2017 / 20:54
1
answer

How to use regex beginning in the middle of the string?

I have a fairly large string and would like to check if a snippet of it matches a regex. The problem is that this snippet is in the middle of the string, in a very specific position. As I will have to do this several times (different strings, di...
asked by 11.01.2017 / 07:39
2
answers

Check if string starts with number

I need to check if a string starts with numbers. I want to do this using Regex in C # public static class StringExtensao { public static bool ComecaComNumero(this string str) { if (string.IsNullOrEmpty(str)) return...
asked by 27.07.2016 / 16:58
2
answers

Simple Quotes vs. Doubles in PHP Regex

Considering that I have a path which I want to check with preg_match if it is the desired path, what is the difference between the two following operations? // Single quoted string preg_match('/\/path\/to\/folder\//', $path) //...
asked by 18.10.2016 / 14:38
1
answer

How to make RegEx for a "serial" number format?

How to do RegExp in the following format: 2015.1.123.5432 Does anyone have any ideas?     
asked by 07.08.2015 / 00:18