Questions tagged as 'regex'

3
answers

Regular expressions in Bash

I'm trying to make a bash script, validate a directory using regular expressions, what I have is the following. echo "Ingresa La ruta de tu directorio" read ruta if [ $ruta != '^/[a-zA-Z]$' ];then echo "No has ingresado una ruta valida, re...
asked by 14.02.2016 / 22:21
3
answers

Get a match in a text with regular expressions

I'm doing a practice in c # and I would like to know how I can get a substring of a string that meets some requirements. For example, I would like to take out what corresponds to a IP that would be 192.168.1.1 . I had thought about re...
asked by 28.04.2017 / 17:14
2
answers

Python convert a string in CamelCase to separated by dashes

Hi, I'm needing to convert a string in CamelCase to separate scripts, I've been trying a bit of regular expressions but I can not get any part of it, the idea is to enter a string in CamelCase: Entry: 'HolaMundoCruel' Exit: 'hola-mundo...
asked by 08.04.2017 / 16:29
1
answer

Nothing to repeat error

This code what does is find in a string the indexes of "[" and "]" , then with substring, I only take the part inside the brackets. Then I draw them in a canvas according to the if: a string that is without the conte...
asked by 29.06.2017 / 13:48
2
answers

Separate text with commas, except in quotes, with regular expressions

I have a string, which I need to separate by comma, except that the comma is in quotes. In my code, it separates me by a comma, but it also separates the comma that is inside the quote. package testSplit; import java.util.StringTokenizer;...
asked by 26.04.2017 / 04:15
1
answer

RegExp option to not enter special characters

I want to create a function which does not allow updating a record if it has special characters. This is the way I'm doing it. I use a RexExp and I enter the characters: onItemUpdating: function(args) { var grupo_promocion; v...
asked by 18.04.2017 / 23:16
3
answers

String.split () to separate in spaces, but without replacing spaces

I have a String like the following: String foo = "soy un texto" When applying the following function: String [] bar = foo. split(" "); He separates it into three texts: "soy", "un" y "texto" However, I want to keep the space...
asked by 18.01.2017 / 19:24
2
answers

Is there a reference to know all the characters that should be escaped in regular expressions?

In a code (Java) I must extract a series of characters from a string. This is the code I'm using: html=html.replaceAll("[«»\"\'“”¿?]",""); If I try to escape the question marks I get an error. Should not the question marks escape? My...
asked by 13.12.2018 / 13:53
2
answers

Problem when retrieving data on Google Sheet using RegexExtract

I have a database in Google Spreadsheet where there are cells that have more than one e-mail address. I am occupying the function RegexExtract , but it only extracts the first address of the e-mail that it finds. How can I make a loop o...
asked by 01.02.2016 / 20:15
2
answers

returns null in regular expressions

I build a regular expression to locate a piece of text: var re = /Incident:(.*)\tDescriptio/gm; var m; while ((m = re.exec(resultados_texto)) !== null) { if (m.index === re.lastIndex) { re.lastIndex++; } } where result...
asked by 18.01.2016 / 14:37