Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
191 views

With regex, I want to get anything between + sign avoid if + with backslash. My string is GroupNo+ \+ +Name+ / +Ac I want to get " \\+ " and " / " with php preg_matchall I tried ...
Moin Uddin's user avatar
2 votes
1 answer
97 views

I have a log file and trying to find instances of 2 consecutive lines. Here is an extract of a file : 21:12:44 | Player "MinecraftNerd8" (DEAD) (id=630DB6BBFCCC2E66508D086E78D202BFA4FB1FB5 ...
ChrisYates's user avatar
4 votes
1 answer
315 views

I have a string of words, here broken into lines to better visualize the repeating pattern: Saint John eats less of those apples. Saint Paul eats more of those berries. Saint Luke eats those ...
Ben's user avatar
  • 821
0 votes
0 answers
31 views

i have need to split string, by regex: split digits together split letters together [ each part should contain between 3-5 chars RANDOMLY ] so if i have: '...
mr.baby123's user avatar
  • 2,322
1 vote
0 answers
90 views

So I am currently using this regex, but I see a flaw in it for p and div tags: (<(p?|div?)>).+(\s|&nbsp;)+(<\/(p?|div?)>)+ Given the current string: <div class="blahblahblah ...
Solomon Closson C's user avatar
1 vote
1 answer
37 views

I'm extracting from bibtex and have a little problem, as the format can have values wrapped inside curly brackets OR NOT. Please find the example text below: @article{Roxas_2011, title={Social ...
May11's user avatar
  • 155
0 votes
4 answers
230 views

So I have a string like this: test //ita https://example.com lics// test // another // one I can capture text between 2 "//" strings easy enough like so: \/\/(.*?)\/\/ Which will return ...
Rob's user avatar
  • 11.4k
0 votes
2 answers
117 views

I want write some function that were accept two parameters $text and $keys. Keys that an array with keys. At the output we need to get an array, where the keys will be the keys passed to the function (...
WatcherD's user avatar
0 votes
0 answers
81 views

So far I have used the preg_match_all function with various expressions, but I am not good at regex. I have a string (downloaded html page). Of course, there are a lot of things on it. Including ...
kamilon123s's user avatar
1 vote
2 answers
151 views

Given the following json string: {"key":"val"ue","other":"invalid ""quo"te"} I want to capture each illegal double quote inside the values. ...
Jeff's user avatar
  • 31
0 votes
3 answers
150 views

Hey im trying to webscrape a specific thing on a website, like this <td><a href="javascript:void(0)" class="rankRow" ...
Ko1ind's user avatar
  • 73
1 vote
1 answer
102 views

Based on this resource (PHP - how to get the signer(s) of a digitally signed PDF?) - I am trying to have a system in PHP that retrieves the digital signature of a file, so that later on I can verify ...
OpenStudio's user avatar
0 votes
3 answers
97 views

I'm using preg_match_all() like this: preg_match_all('/("user":"(.*?)".*?-->)/', $input_lines, $output_array); On a string, the idea is that I want it to get whatever comes ...
pg.'s user avatar
  • 2,531
0 votes
0 answers
32 views

I am using preg_match_all in php to try to do some matching replacing and basic templating My php match code is preg_match_all( '/\{(.*?)\}/', $message, $match); the content that is being passed in ...
Dannymh's user avatar
  • 149
1 vote
1 answer
35 views

I need with preg_match_all() to extract all [ANY_TEXT-pb] blocks. My code: $content = 'START Text1 [news-block] text2 [title1-pb] text3 text4 [title2-pb] text5 END'; preg_match_all('/\[(.*?)pb\]/si', $...
lolalola's user avatar
  • 3,821
1 vote
1 answer
88 views

I have a function that will find an email string that is in a specific format. I need to find this specific email string within the larger string. The specific email string I need to find has to be in ...
Alex Douglas's user avatar
0 votes
0 answers
40 views

Can anybody help me please. I get an url and need to take the last part after -. Example data game-when-no-one-at-xhU8c0dL coins-at-the-desk-1xhz83c example-example-1391340 Result needed xhU8c0dL ...
Dimitrie's user avatar
0 votes
1 answer
100 views

Using the PHP v8 preg_match_all($Matches) function's "Match" parameter, I need to match a list of literal text and delimited tokens. $x = preg_match_all($Regex, $Template, $Matches, ...
Russ's user avatar
  • 31
1 vote
1 answer
74 views

I have a preg_match to get dates from a string: preg_match_all('/\d{1,2}\.\d{1,2}\.\d{2,4}/',$myString,$dates); This will get dates with the syntax: 01.01.2022 1.01.2022 1.1.2022 1.1.22 ... Now I ...
Trombone0904's user avatar
  • 4,276
0 votes
0 answers
50 views

I have a piece of code (which I did not write) where a error is given when trying to call the pre_match_all function: $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]...
Barry V.'s user avatar
0 votes
1 answer
68 views

{"popUp":false,"token":"NS2938f08ubjk765vhjJBKJB78vhjeec1_m1_7"} This is curl response in JSON, and i want to extract token from this JSON response. i used ...
KRISHN4's user avatar
0 votes
1 answer
119 views

I have following code: <?php $html = '<div> <div class="block"> <div class="id">10</div> <div class="name">first ...
smiady's user avatar
  • 135
0 votes
0 answers
16 views

i have a code <?php $string='afdsfd data-win="3453453ASSS" some text data-win="3434534ASDDD" some more text data-win="1233RTYYY"'; preg_match_all('/data-win="([^&...
Apurva's user avatar
  • 525
0 votes
0 answers
55 views

Take this string: $string = "wanted NOT IN OR" preg_match_all('/\w+/', $string, $WordArray); // outputs each word into array But what if I do not want to split on the whitespace right ...
ThomasK's user avatar
  • 2,240
0 votes
0 answers
47 views

Below is the JavaScript source code on which the php regex I am trying to apply. <script> function outerfunction () { function abcd () { return ('efgh', 1); } function efgh ...
Amit Shah's user avatar
  • 8,209
1 vote
1 answer
54 views

I'm currently working on a script. The following code is included: if(preg_match_all('!href="(\[^"\]+fref=fr_tab)"!',$contents,$aMatch)) This only applies if part of the link fref=fr-...
Henning's user avatar
  • 11
1 vote
2 answers
134 views

I have the following problem where I'm stuck for hours: I have an array with my regex, where I want to match with the subject from another array. Regex array: Array ( [tax] => /^(\S+\w)/ [...
Mirko Babic's user avatar
1 vote
0 answers
65 views

I have a string like: $string = "P 1 BNN-01 HV A7weg letsel (Auto) A7 Re 138,3 HASKERHORNE."; I want to get the "138,3" part to use as variable like $number = "138,3". I ...
Edwin Tjallings's user avatar
-5 votes
2 answers
78 views

I have a list of links (that also have some svg icons in the a - it makes my pattern more complex, that's why I mention this), and I want to grab two particular ones. So if this is the subject to ...
Faye D.'s user avatar
  • 724
1 vote
1 answer
61 views

I'm in need of a regexp that will allow me to retrieve all the following data from a php source file : MUI('Some text') MUI("Some text", $lang) The regexp is used to extract all the terms ...
BlackPage's user avatar
  • 107
0 votes
1 answer
2k views

I've been programming in Power Apps for some time now (but I'm not a specialist). I'm trying to pass an array from Power Automate to Power Apps. I was able to do that with a string and after a few ...
Thomas Schmidt's user avatar
0 votes
1 answer
57 views

I have variables gathered from another website with preg_match_all and echo the value. But the value is in $var1[0][n], n>0 form;I couldn't inserted the value into mysql. Thanks for any help. $path=...
nanomaho's user avatar
-1 votes
2 answers
842 views

I am trying to make this work but I can't: $str = "<html>1</html><html>2</html><html>3</html>"; $matches = array(); preg_match_all("(?<=<html&...
stavros.3p's user avatar
  • 2,334
0 votes
2 answers
62 views

Using PHP's preg_match_all I have the following problem. Example string: last_name, first_name bjorge, philip sdfsdf credit note dfsdf kardashian, kim mercury, freddie Regex: /\bcredit\b|\bcredit ...
Robbert's user avatar
  • 11
-2 votes
1 answer
126 views

Im trying to make preg_match_all regex that will work in next order. Group 1 to match "Example", Group 2 to match "[string]", Group 3 to match whitespace and "Number" and ...
Sinisa's user avatar
  • 82
2 votes
1 answer
57 views

Here I am having one preg [-0-9a-zA-Z \/_:.,;=\'{0,2}"{0,2}\s]+$ With this I want to check lines whether they contains Alphabets, Numeric and some special character such as - _ , . ; ' " / =...
be MrZulf's user avatar
  • 430
-1 votes
1 answer
53 views

I have a text string and a list of words as key => word to match if any of the words are present in the string. If words are present, I would like to output a comma separated list of all the ...
Boris Smolyanov's user avatar
0 votes
1 answer
65 views

I am still newbie so maybe it is simple but, I tried lot of things i found here and still cant get it right. $patternPopis ='/(?:[^:|\d ])[A-Za-zÀ-ȕ .?+\d]+(?=\n)/i'; preg_match($patternPopis, $row, $...
Michal Mareš's user avatar
1 vote
2 answers
86 views

A string may contain non-number in braces which needs to be deleted. Input can be multiline too, for example : input: # (1437) # {19} (917) (1437) # {19} (1437) [1449] [2474] [2098] [1351] [508] ...
www.friend0.in's user avatar
0 votes
0 answers
17 views

I am working in PHP and I am trying to use str_replace in a text with unicode characters. If I replace with this code, this works fine: $message = str_replace($unicode_char, "\u{1F44B}", $...
user1228739's user avatar
0 votes
1 answer
73 views

I am trying to access the values from the results of preg_match_all. Below is my coding: $strNbrOfPages = preg_match_all($strPattern,$strWorkDetails,$matches,PREG_OFFSET_CAPTURE); Below is the ...
Martha J Sayers's user avatar
0 votes
2 answers
161 views

I want to search the ip addresses in the txt file. A single ip address shows the result when I log in, but when I type more than one ip address in the textarea, the result is not found. Can anyone ...
Mert's user avatar
  • 3
1 vote
1 answer
70 views

I try to find all occurrences of a substring in text, using the preg_match_all() function: <?php $str = '<p>this <a href="https://api.slack.com/apps/" target="_blank&...
Slava Rozhnev's user avatar
0 votes
1 answer
86 views

I have two types of bbcode: [attach]1234[/attach] [attach=full]1234[/attach] $message = 'this is message with attach [attach=full]1234[/attach] I want to remove everything from string and using: (...
Dimitry's user avatar
  • 63
2 votes
2 answers
69 views

I would like to validate my input string and extract an unpredictable number of substrings from it -- with one regex pattern. An example string: location in [chambre, cuisine, salle-de-bain, jardin] ...
Alexandre Tranchant's user avatar
0 votes
1 answer
63 views

I have this text. *s* *q: what is 3+3? *. *o: 3 *. *o: 4 *. *o: 6 *. *e* *s* *q: what is 4*4? *. *o: 7 *. *o: 12 *. *o: 16 *. *e* *s* *q: what is 10/2? *. *o: 1 *. *o: 5 *. *e* I wrote the ...
ashokkumar s.'s user avatar
0 votes
1 answer
81 views

I have this string: not(matches(#[Sécurité][Alarme][Mode]#, ["Desarmer",{"action":"Desarmer Sys"}]), result). And I want to extract the name of the function: not And I ...
francis's user avatar
  • 41
1 vote
2 answers
201 views

I am sending a few telnet cmds to a device and reading back its result values in a array. I need to filter the data, but I'm not sure if preg_split() or preg_match() is better suited. After isolating ...
0p3nS0urc3 2015's user avatar
0 votes
3 answers
106 views

From a multiline input I want to move tokens if they're inside {} and match some number. Sample input # (811) (1485) [2756] {29} [555] {15} # (811) (1476) {20} {15} (1485) [196] [2441] # (911) (619) ...
www.friend0.in's user avatar
0 votes
1 answer
175 views

I am trying (with no success) to get all possible matches with preg_match_all(). Any help would be greatly apreciated. Thank you in advance. No related questions and answers clearly give a way to do ...
Mathieu Lafourcade's user avatar

1
2 3 4 5
39