Questions tagged as 'regex'

1
answer

Get some of the contents of the SVG ID with PHP

I have a file SVG and it has several paths with the tag and inside the tag has the id attribute that in turn has the name of the state and also the municipality (which is what I need to get). I would like to get this municipa...
asked by 06.08.2016 / 17:34
3
answers

Remove input letters using Javascript and regular expression [duplicate]

I have an input field that gets a value. I would like to remove letters and special characters from the value of this input, leaving only numbers remaining. I think it would be easier to use a replace with a regular expression, but I can not....
asked by 07.04.2016 / 20:09
2
answers

Activate TAB key for next field in RegExp

Good morning, I'm developing a form where I have a "username" field, in this field I use this RegExp("^[0-9a-zA-Z \b]+$") , it works perfectly, however when I use the TAB key to move to the next field it does not work! I've already tried u...
asked by 15.03.2016 / 13:17
1
answer

Validate CNPJ countries Latin America [closed]

I am doing a validation of CNPJ from the countries of Latin America. I do not really understand Regex and would like help to validate the following rule:    3 digits, 6 numbers (YYMMDD), 3 digits (like P & G851223B24) The field has...
asked by 21.01.2016 / 15:02
1
answer

If you have this character, discard the catch

How do I make regular expression not capture what has \} in text? I want you to get all } , but I want it to be escaped with the \ character be discarded, not ignored. I am trying this expression: [^\]} but it returns a ch...
asked by 15.11.2015 / 22:06
1
answer

Regular expression does not detect first entity

This expression: (?<=.*"")\s is not detecting the first space it should detect: <object name="Arrow" id="40" price="$400" description="Uma flecha comum."> The correct would be to detect the following: <object name="Arr...
asked by 20.09.2015 / 03:30
1
answer

Get string before with regex

I need to make a regex for an application from which I need to remove a certain combination of characters from within a string. Explaining the problem better. I have a string that returns from the database, something like this: EVENTDATE:10...
asked by 28.09.2015 / 14:30
1
answer

preg_split to separate words, but ignoring some

I need a regular expression that divides a string, more specifically a complete name of a person, and turns it into an array of words. $string = "Wallace de Souza Vizerra"; $array = preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY); ['Wa...
asked by 03.07.2015 / 22:06
2
answers

Python - get data from .txt file with regex

Hello, I'm trying to make a program but I'm not able to remove the data from the .txt file, it would look more or less bold. PokerStars Hand #135235596385: Tournament #1228747530, $0.23+$0.02 USD Hold'em No Limit - Level I (10/20) - 2015/05/14...
asked by 22.05.2015 / 20:02
1
answer

"Escape" externally loaded file string

Problem: I am trying to pass to the database a String containing the bytes of an image that was loaded externally to put into a BLOB field. As always, the bytes in the image have single quotes ' , double quotes " and backsla...
asked by 29.08.2014 / 21:58