Note that there are some explanatory texts on larger screens.

plurals
  1. PORegEx conversion Javascript to PHP
    primarykey
    data
    text
    <p>currently I'm using the following RegEx in a Javascript code of mine:</p> <pre><code>'(?:' + tags + '):([\\s\\S]*?)(?=\\s+(?:' + tags + '|END):)' </code></pre> <p>..as it's a dynamic RegEx, the variable 'tags' is used for the several parameters i want to filter for.</p> <p>How would the RegEx look like in PHP code? I get the following part work:</p> <pre><code>(?:' + tags + '):([\\s\\S]*?) </code></pre> <p>But the second part wont work with PHP, no matter what I try:</p> <pre><code>(?=\\s+(?:' + tags + '|END):) </code></pre> <p>Thank you for your help!</p> <p>Edit 1:</p> <p>My current PHP code looks like this:</p> <pre><code>$regexp = '(?:'.$tags.'):([\\s\\S]*?)(?=\\s+(?:'.$tags.'|END):)'; </code></pre> <p>Edit 2:</p> <p>I'm trying to find the following tags/parameters:</p> <pre><code>$tags = 'X-WR-CALNAME|X-WR-TIMEZONE|X-WR-CALDESC|BEGIN|CLASS|DTSTAMP|UID|CREATED|LAST-MODIFIED|SEQUENCE|STATUS|TRANSP|X-MICROSOFT-CDO-BUSYSTATUS|ORGANIZER|SUMMARY|DESCRIPTION|LOCATION|DTSTART|DTEND|END'; </code></pre> <p>...out of a text which looks like this:</p> <blockquote> <p>BEGIN:VEVENT DTSTART:20121117T143000Z DTEND:20121117T163000Z DTSTAMP:20121130T185808Z UID:n3f3qjgtads37phsq3oovmvouc@google.com CREATED:20121102T191518Z DESCRIPTION:1. Bundesliga\, 12. Spieltag \n\nhttp://www.fussball-spielplan. info LAST-MODIFIED:20121117T170303Z LOCATION:Imtech-Arena\, Hamburg SEQUENCE:0 STATUS:CONFIRMED SUMMARY:Hamburger SV - 1. FSV Mainz 05 (1:0) TRANSP:TRANSPARENT END:VEVENT</p> </blockquote> <p>..in order to get the value right next to the appropriate tag/parameter.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload