Questions tagged as 'regex'

1
answer

How to create pattern with jQuery Validation Plugin?

I need to create a input mask (pattern) for the CPF type 000.000.000-00 and for CNPJ 00.000.000 / 0000-00 via the jQuery Validation plugin. What would be the regex to be creating this validation? Note: CPF and CNPJ will be two differe...
asked by 01.12.2016 / 19:32
1
answer

Search for content within two html tags - Regex

I have an HTML page in a string variable. I need to look inside the h2 tags of the whole document if the word "Blog" exists. I'm using pregmatch but I can not create the expression to find. Can you help me one more time? Thank you!     
asked by 19.08.2016 / 01:37
1
answer

REGEX - extract part of the text in a string

I have the following string == > "the guy with the mush he hit with the car in the car of so and so" I'm trying to extract starting from ^ ("the guy ...") and ending in ("... the car") $ Can someone help me with this RE     
asked by 10.06.2016 / 01:53
2
answers

Regex works in online tester but does not work on my site in javascript

Website link where I tested regex var string = "12.0,34.0"; var re = new RegExp("[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+))?"); if (re.test(string)) { console.log("Valida");...
asked by 01.06.2016 / 11:45
1
answer

How to use the pattern to delimit a minimum number in an input text?

Hello, I need to define that the minimum number entered in an input of type text is number 5, I tried as follows: <input type="text" name="someName" id="someId" required="required" pattern="(([1-9]?[0-9]?[5-9]?)|([0-9]?[5-9]?)|([5-9]?))"/&g...
asked by 18.05.2016 / 05:22
1
answer

.htaccess detect string after slash

I'm not getting htaccess to detect string or characters after / for example. I have this: xpto.xpto / xx / And I wanted it when this happened xpto.xpto / xx / cualquecoisa .htaccess internally executes a php code I tried th...
asked by 15.03.2016 / 17:55
2
answers

Regex to validate data yyyy / mm / dd?

I have tried several expressions, but I did not get the desired result. How can I validate the date for yyyy/mm/dd ?     
asked by 25.05.2016 / 17:08
3
answers

PHP Regex Get the html tag

Good afternoon I would like to ask for help to make a regex that separates the values of this string: <table>|<tr>[<td>#VALOR#</td>]</tr>|</table> I would need the regex to break the values as follows:...
asked by 19.02.2016 / 15:02
2
answers

Remove substring with regex

I have the string: var str = "Quantidade [12]"; I need to retrieve the string but remove the space and [12], ie I need to return only the value: Quantity . In case the string is var str = "Quantidade máxima [12]"; , I need to get...
asked by 02.10.2015 / 22:46
1
answer

jquery inputmask does not accept quantifier in function "validator"

I'm trying to make a customAlias to use with jQuery Inputmask, but I'm facing the following problem: My input: <input id="input-field-nome" data-inputmask="'alias':'customAlias'" type="text" data-rule-required="true" class="form-co...
asked by 09.10.2015 / 17:18