Questions tagged as 'regex'

1
answer

Find hidden word with regex

I'm trying to find a hidden word with regex, but I do not understand why my code does not work. String s = "ahwereovnkejfnlvienfvia"; String regex = "[a-z]h[a-z]o[a-z]l[a-z]a[a-z]"; String regex2 = ".h.o.l.a." Pattern p = Pattern.compile(regex...
asked by 12.08.2017 / 14:41
3
answers

capture the values of the option regex attributes by groups

I have this regular expression <option\s?(value="(.+?)?")?\s?(selected="selected")?>(.+?)<\/option>  validating in the content of a page the option labels of a select that are created dynamically. I need to capture the value i...
asked by 15.11.2017 / 16:41
1
answer

Regex to replace special characters - JAVA

I have this function in Java, quite dirty and a little bad, what it does is pick up a word and replace the 'special' characters, I would like to know another more ergonomic way to do it, if it is with a Regex or with something else. private St...
asked by 26.09.2018 / 09:54
1
answer

Securing routes under the same firewall

I have a symfony2 application with an api rest and a sonataAdmin backend. In the security.yml file I have the following: security: encoders: FOS\UserBundle\Model\UserInterface: bcrypt role_hierarchy: ROLE_ADMIN: [R...
asked by 18.05.2017 / 06:37
2
answers

RegExp that detects if it matches a word, considering duplicate spaces and / or letters

I worked with NodeJS , I had a system that verified whether a string contained a certain blocked word, however, it was easy to dodge the system. (It replaced all the unicode characters to "" , so it's very inefficient). I would like to...
asked by 03.03.2017 / 18:27
1
answer

Validation of Letters in Codeigniter

I am developing an application in
asked by 22.09.2016 / 14:04
1
answer

optional groups in regular expressions

Answering another question in SO, I was asked the question of how to deal with regular expressions when they contain optional groups. For example, if you would like to capture the phone number and favorite number in the following text:   ...
asked by 17.03.2018 / 02:14
1
answer

Problem with (.) in friendly url

I have a website where I show a catalog of products, which with the famous friendly url, transforms said url. I have: www.miweb.com/productos/Plancha-para-ropa-nghkdk23 And redirect to: www.miweb.com/productos/productos.php?idproduct...
asked by 02.11.2016 / 13:45
1
answer

Error getting names with apostrophes when using regex java android

I have a problem with this regex code to get text strings with apostrophes obtained through streaming. The code I use is this: public static Map<String, String> parseMetadata(String metaString) { Map<String, String> metadata =...
asked by 20.05.2017 / 01:23
2
answers

Capture a group without capture or group capture with capture

Today answering a question on this site I found myself with a very interesting possible solution, because I accidentally deleted a part of the solution and that solution worked although it did not make sense for me. Without further ado:...
asked by 03.03.2018 / 17:32