Questions tagged as 'regex'

1
answer

Get part of a string with Regular Expression - C #

Based on the string "Plane Liberty Company +50 - 043-98965-2784 (058 / POS / SMP)", I need to get the part of "043-98965-2784". I noticed that in the txt file I'm using, the numbers follow the pattern "000-00000-0000". Could anyone help me...
asked by 31.10.2017 / 15:40
1
answer

Keep characters in substitution with regex in gedit

I have the following text segment in a .csv file 5/29/17;08:17;Fulano;Teatro Companhia Rua do Canto, 301/305 Esquina da rua meio De segunda a sexta das 9h as 18h 5/29/17;08:18;Ciclano;legal I need to have lines 2,3 and 4 together with line...
asked by 16.08.2017 / 17:15
1
answer

PHP Regex Issues

I'm trying to get some information from a webpage and I'm using regex for it. I'm using regex101.com to test the pattern and got to one that suits me perfectly. It happens that this pattern works perfectly on regex101.com, but when I do the s...
asked by 11.08.2017 / 16:27
2
answers

Regular expression to select whole word and case sensitive in accented word

I need to make a program that searches a particular word in a set of texts and labels the searched word in the middle of the text. For this I developed the following method: public void grifarTexto(Relato relato, String texto) { relato...
asked by 15.07.2017 / 21:47
1
answer

Regex to wrap console.log expression in eclipse find / replace

I'm trying to wrap all console.log(); of my code with condicional if(showLog) { } . I was learning regex and found that I was able to select all console.log() expressions including those separated in several lines by eclipse...
asked by 17.03.2017 / 23:58
1
answer

Make different combinations of words within a sentence

As an example I have the following sentence: texto = O gato subiu no telhado de 10m, um homem jogou-lhe uma pedra e ele caiu de uma altura de 20m. I want to extract the following information: (O gato subiu 10m, O gato caiu 20m...
asked by 12.04.2017 / 22:17
1
answer

Is it possible to bypass a regular expression?

I'm reading a bit about regex for some validations and wanted to know if there is any way to circumvent some rule, for example: $rule = "/[^A-Za-z0-9]/"; I found this to validate alphanumeric fields, is there any way to circumvent this and...
asked by 25.08.2016 / 04:21
2
answers

How to limit the number of houses before the comma in a regular expression?

I'm using this expression to not let the user type a dot before any number and limiting 2 boxes after the comma, but I also needed to limit 5 boxes before the comma, the way I am I can insert as many numbers as I can before the comma . Does anyo...
asked by 04.12.2015 / 18:02
1
answer

URL rewriting with "+" sign (same as Google+) .htaccess

I would like to write a rule in .htaccess with RewriteRule using the plus sign (+) for a url in the format similar to Google, like this: myite.com /+anything was interpreted myite.com /?track=search or mysite.com / a site was interpret...
asked by 09.11.2015 / 22:41
1
answer

HTACCESS - Directory exclusion condition

Good evening! I have the following scenario in an application: I'm redirecting all requests to my index.php and handling URL's through the application: RewriteCond %{REQUEST_URI} !admin RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|...
asked by 21.12.2015 / 02:30