menu

Recent questions tagged regular-expressions

1 vote
1 answer
Why doesn't the regular expression work correctly? I need to get "Moscow" from the url https://mysite.me/ru/Moscow?lang=ru To do this, I use the template (^\/)(?) and the output is "Moscow?" How to refine the pa ...
by artalexs
asked Sep 24, 2021
1 vote
1 answer
How do I remove the right values from the text? I need to remove all UPC and Model from the string, and add it to the list, i.e. to list it like this: 'UPC: 086279034038' , 'Model:FCT22-30HNS '. Here's the code: i ...
by Panda_Code
asked Sep 24, 2021
1 vote
2 answers
A regular expression does not see the "-" symbol. How to solve it? There are url patterns, but regular expressions do not see the "-" sign. Here is the code leading to the regular: $to_match = preg_replace('/{(a-z+):(^\}+)}/', '( ...
by nurasyl_mels
asked Sep 23, 2021
1 vote
1 answer
How do I write a regular expression hours:minutes? Hello, could you please suggest a regular to check the time in hours : minutes format. Thank you. ...
by Stim7
asked Sep 22, 2021
1 vote
1 answer
How can I disable spaces, brackets and dashes in a field? I'm trying to create a character banning routine, but I can only individually ban either spaces with ^\S$ or other characters with ^\(\)\-$, but they won't work toge ...
1 vote
2 answers
How can I use a regular expression to add line breaks? How can I use a regular expression to add line breaks? Turn this kind of markup <span></span><span></span><span></span> In such a ...
by CityzenUNDEAD
asked Sep 20, 2021
1 vote
1 answer
How to get individual elements of a string with a regular? I get a set of strings of the following form by a regular expression from html /reports/schedule/Group/14779_1_26102020_08112020.pdf groupRegexp := regexp.MustCompile ...
by kr_ilya
asked Sep 20, 2021
1 vote
1 answer
image
Which regular gives the numbering in order? The text qwerty appears many times in the text document Please tell me the regulars for notepad++ to rename qwerty to numbers in order, starting from 1551 to 4323 === ...
by mik777em
asked Sep 20, 2021
1 vote
2 answers
How do I fix the regular to look for the last occurrence of these extensions? There is a code Кодif (stripos($uri, 'admin') === false) { if (isset($_SERVER'HTTP_ACCEPT') && isset($_SERVER'HTTP_USER_AGENT')) { ...
by Dentosx
asked Sep 20, 2021
1 vote
2 answers
How do I get 301 dynamic redirect on Apache? site.ru/?page=3 to site.ru/page/3/ (any number is possible) How do I get 301 dynamic redirect on Apache? ...
1 vote
1 answer
How to remove unwanted characters from a string with re? There is a line of the form ' .,Qwertt/werwer/wer qwer qer/qwert /' We need to remove spaces, commas, slashes, etc. from the beginning and end of the string using the m ...
by digit14
asked Sep 18, 2021
1 vote
1 answer
Why do we need anticipatory and retrospective inspections? There is an example in the article: As a first example, find the value from the line "1 turkey costs 30E". That is, find a number followed by a currency sign E. And th ...
by dimentimor
asked Sep 18, 2021
1 vote
1 answer
A regular expression to replace text? Good day. There is a description of the product in the online store. It consists of a text part (at the beginning) and a table with characteristics (at the end). And I ...
by shurc
asked Sep 18, 2021
1 vote
1 answer
How do I add " " to each REGEX line? I have a large list of asnes 209843 209896 209999 210015 210239 212811 213058 213137 213254 213322 213367 262267 262916 263168 263203 and I need to add " ...
by qukallon
asked Apr 4, 2021
1 vote
1 answer
How do I replace an Instagram nickname with a link? Hello, colleagues! Please tell me how to replace @username with a link like this @username in php using regular expressions. If username is in text like say here @us ...
by dmitred
asked Apr 3, 2021
1 vote
1 answer
How do I cut out everything in a string except for certain values? Hello. There are lines like this: d32d32d slot1=342 xqw dd3 d3 slot2=125 d32djk3 mdmkdm32od 3 slot3=13 yuguy m jhj We need to get this result: slot1=342 slot2=125 slot ...
1 vote
1 answer
и Hi, there's a line. жигули, тойота, ваз, заз ...
by feniksdv
asked Apr 1, 2021
1 vote
1 answer
How do I make up a regex? I need to input l 1232 to output 1232 with this works l (.) ...
by fsfsfs32
asked Mar 30, 2021
1 vote
3 answers
1 vote
1 answer
image
Regular expression, how to skip empty tags? Good afternoon. My regularvar reg=/>(^(>|<|)+)(<|>)/ catches text between page tags. An example is in the photo. Is there any way to skip empty tags, in ...
by Astral100498
asked Mar 30, 2021