1import{j as _,c as y,a as K,Q as ee,r as te,o as a,b as o,d as m,e,l as $,i as I,f as d,q as T,v as L,F as u,g,t as n,m as w,L as P,n as J}from"./index.1e25d437.js";import{N as se,_ as re}from"./Navigation.10511c44.js";import{_ as ne}from"./RelatedLinks.vue_vue_type_script_setup_true_lang.bef8c7e9.js";import{_ as ae}from"./Breadcrumbs.9fabf4a2.js";import{C as oe}from"./CallToAction.124e262f.js";import{_ as ie}from"./Faq.6f4728d1.js";import{_ as le}from"./Integrations.ed2c840f.js";import{mdiFlash as ce,mdiShieldLock as de,mdiRegex as pe,mdiSwapHorizontal as ue,mdiBookOpenVariant as xe,mdiCodeBraces as me,mdiCodeTags as ge,mdiBugCheck as he,mdiChartLine as be,mdiRocketLaunch as fe}from"./mdi.4e1f652c.js";import{o as ve}from"./screenshot.dd69818e.js";import"./_plugin-vue_export-helper.cdc0426e.js";import"./JsonLd.59b3b883.js";const _e={class:"relative bg-surface-0"},ke={class:"relative z-10 mx-auto max-w-6xl px-6 pt-32 pb-24 lg:px-8 lg:pt-40"},ye={class:"mb-8"},we={class:"max-w-3xl"},$e=P('<h1 class="font-display text-4xl sm:text-5xl font-semibold tracking-tight text-ink-strong mb-6 leading-tight"> Live <span class="text-brand-400">regex tester</span></h1><p class="text-xl lg:text-2xl text-ink-base mb-8 leading-relaxed"> Test JavaScript regular expressions <span class="text-brand-400 font-semibold">instantly in your browser</span>. Match highlighting, capture groups, replacement preview, and quick reference for every flag. Nothing leaves your machine. </p><div class="flex flex-col sm:flex-row gap-4 mb-8"><a href="#try-it" class="group inline-flex items-center justify-center px-8 py-4 text-lg font-semibold text-ink-strong bg-gradient-to-r from-brand-600 to-brand-500 rounded-xl hover:from-brand-500 hover:to-brand-400 transition-all duration-200 hover:scale-105 shadow-xl shadow-brand-600/30"><span>Start Testing</span><svg class="w-5 h-5 ml-2 transform group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H3"></path></svg></a><a href="https://app.scrappey.com/#/register" class="inline-flex items-center justify-center px-8 py-4 text-lg font-semibold text-ink-base border border-surface-hairline rounded-xl hover:border-brand-500/50 hover:text-ink-strong hover:bg-surface-raised/50 transition-all duration-200"> Get Scrappey Free </a></div><p class="text-sm text-ink-muted"> 100% client-side \u2022 No registration \u2022 Works offline </p>',4),Se={class:"text-sm text-ink-muted mt-3"},Ce={class:"bg-surface-0"},Ne={class:"relative bg-surface-0 py-16 sm:py-24 border-t border-surface-hairline/50"},Te=e("div",{class:"pointer-events-none absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-brand-400/40 to-transparent"},null,-1),Le={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8"},Ee={class:"grid grid-cols-1 lg:grid-cols-2 gap-8 items-center"},Re=P('<div class="rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-8"><h2 class="font-display text-3xl sm:text-4xl font-semibold tracking-tight text-ink-strong mb-4">What is a regex?</h2><div class="prose prose-invert max-w-none"><p class="text-ink-base leading-relaxed mb-4"> A regular expression (<code class="text-brand-400">regex</code>) is a compact pattern language for finding, validating, and extracting text. Every modern language ships a regex engine \u2014 but writing patterns blind is painful, and a wrong character class can silently break production. </p><p class="text-ink-base leading-relaxed mb-4"> This tester evaluates your pattern with the same <strong>JavaScript regex engine</strong> your browser and Node.js use. You'll see <strong>every match, every capture group, and any replacement</strong> as you type \u2014 no compile step, no server roundtrip. </p><p class="text-ink-base leading-relaxed"> Common uses: parsing scraped HTML, validating user input, building extraction rules for Scrappey scrapers, writing log filters, and replacing structured strings at scale. </p></div></div>',1),je={class:"rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-6"},Pe={class:"aspect-[4/3] bg-surface-0/50 rounded-lg flex items-center justify-center border border-surface-hairline/30 overflow-hidden"},Me=["src"],Be={id:"try-it",class:"relative bg-surface-0 py-16 sm:py-24 border-t border-surface-hairline/50"}
1,Fe=e("div",{class:"pointer-events-none absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-brand-400/40 to-transparent"},null,-1),Ae={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8"},ze=e("div",{class:"text-center mb-12"},[e("h2",{class:"font-display text-3xl sm:text-4xl font-semibold tracking-tight text-ink-strong mb-4"}," Test your regex "),e("p",{class:"text-xl text-ink-muted"},"Type a pattern and a test string \u2014 matches update in real time")],-1),Ie={class:"rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-6 sm:p-8 space-y-6"},Je=e("label",{class:"block text-sm font-medium text-ink-base mb-2"},"Pattern",-1),De={class:"flex items-stretch rounded-lg overflow-hidden border border-surface-hairline focus-within:ring-2 focus-within:ring-brand-500"},He=e("span",{class:"px-3 flex items-center bg-surface-0/70 text-brand-400 font-mono text-lg select-none"},"/",-1),Oe=e("span",{class:"px-3 flex items-center bg-surface-0/70 text-brand-400 font-mono text-lg select-none"},"/",-1),Ge={class:"flex flex-wrap gap-2 mt-3"},Ve=["onClick","title"],Ue={key:0,class:"text-red-400 text-sm mt-3 font-mono"},We=e("label",{class:"block text-sm font-medium text-ink-base"},"Test string",-1),qe={key:0},Qe={class:"flex items-center justify-between mb-2"},Xe=e("label",{class:"block text-sm font-medium text-ink-base"},"Highlighted matches",-1),Ye={class:"text-xs text-ink-muted font-mono"},Ze={class:"bg-surface-0/50 border border-surface-hairline/30 rounded-lg p-4 max-h-72 overflow-y-auto"},Ke=["innerHTML"],et={key:1},tt={class:"flex items-center justify-between mb-2"},st=e("label",{class:"block text-sm font-medium text-ink-base"},"Match details",-1),rt={class:"bg-surface-0/50 border border-surface-hairline/30 rounded-lg p-3 max-h-72 overflow-y-auto space-y-2"},nt={class:"flex items-center gap-3 mb-1"},at={class:"text-xs text-ink-muted"},ot={class:"text-xs text-ink-muted"},it={class:"text-brand-400 break-all"},lt={key:0,class:"mt-2 pl-3 border-l-2 border-brand-500/40 space-y-1"},ct={class:"text-ink-base"},dt={class:"text-emerald-400 ml-2 break-all"},pt={key:1,class:"mt-2 pl-3 border-l-2 border-emerald-500/40 space-y-1"},ut={class:"text-ink-base"},xt={class:"text-emerald-400 ml-2 break-all"},mt={key:2,class:"text-center py-8 text-ink-muted text-sm"},gt=e("label",{class:"block text-sm font-medium text-ink-base mb-2"},[$(" Replacement "),e("span",{class:"text-ink-muted text-xs"},"(supports $1, $2, $<name>)")],-1),ht={key:0,class:"mt-3"},bt={class:"flex items-center justify-between mb-2"},ft=e("label",{class:"block text-xs text-ink-muted"},"Result",-1),vt={class:"bg-surface-0/50 border border-surface-hairline/30 rounded-lg p-3 text-sm font-mono whitespace-pre-wrap break-words text-ink-base max-h-60 overflow-y-auto"},_t={class:"relative bg-surface-0 py-16 sm:py-24 border-t border-surface-hairline/50"},kt=e("div",{class:"pointer-events-none absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-brand-400/40 to-transparent"},null,-1),yt={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8"},wt=e("div",{class:"text-center mb-12"},[e("h2",{class:"font-display text-3xl sm:text-4xl font-semibold tracking-tight text-ink-strong mb-4"}," Quick reference "),e("p",{class:"text-xl text-ink-muted"},"The patterns you'll reach for most often")],-1),$t={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},St={class:"font-display text-base font-semibold tracking-tight text-ink-strong mb-3"},Ct={class:"space-y-2"},Nt={class:"text-brand-400 font-mono whitespace-nowrap flex-shrink-0"},Tt={class:"text-ink-muted"},Lt=P('<div class="py-12 bg-gradient-to-br from-brand-600/20 to-emerald-600/20"><div class="max-w-4xl mx-auto px-6"><div class="relative bg-surface-raised/50 backdrop-blur-sm rounded-2xl p-6 border border-brand-400/50"><div class="flex items-center justify-between gap-4 flex-wrap"><div class="flex-1"><h3 class="text-lg font-bold text-ink-strong mb-2"> Use your regex on real web data </h3><p class="text-sm text-ink-base"> Scrappey returns clean HTML, JSON, or Markdown from any URL \u2014 pipe it straight into the patterns you tested here. </p></div><a href="https://app.scrappey.com/#/register" target="_blank" class="inline-flex items-center justify-center px-6 py-3 text-base font-semibold text-ink-strong bg-brand-600 rounded-lg hover:bg-brand-500 transition-all duration-200 hover:scale-105 shadow-lg shadow-brand-600/20 whitespace-nowrap"> Start Free Demo Trial <svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg></a></div></div></div></div>',1),Et={class:"relative bg-surface-0 py-16 sm:py-24 border-t border-surface-hairline/50"},Rt=e("div",{class:"pointer-events-none absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-brand-400/40 to-transparent"},null,-1),jt={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8"},Pt=e("div",{class:"text-center mb-12"},[e("h2",{class:"font-display text-3xl sm:text-4xl font-semibold tracking-tight text-ink-strong mb-4"}," Why use Scrappey's regex tester? "),e("p",{class:"text-xl text-ink-muted"},"Built for developers who scrape, parse, and validate")],-1),Mt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},Bt={class:"mb-4 flex items-center justify-center w-11 h-11 rounded-xl bg-brand-500/10 border border-brand-400/30"},Ft={class:"w-6 h-6 text-brand-400",viewBox:"0 0 24 24",fill:"currentColor"},At=["d"],zt={class:"font-display text-base font-semibold tracking-tight text-ink-strong mb-2"},It={class:"text-ink-muted text-sm"},Jt={class:"relative bg-surface-0 py-16 sm:py-24 border-t border-surface-hairline/50"},Dt=e("div",{class:"pointer-events-none absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-brand-400/40 to-transparent"},null,-1),Ht={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8"},Ot=e("div",{class:"text-center mb-12"},[e("h2",{class:"font-display text-3xl sm:text-4xl font-semibold tracking-tight text-ink-strong mb-4"}," Use your regex in code "),e("p",{class:"text-xl text-ink-muted"},"Drop the tested pattern into your scraper or parser")],-1),Gt={class:"rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-8"},Vt={class:"flex items-center justify-between mb-4"},Ut={class:"flex gap-2"},Wt=["onClick"],qt=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),Qt={class:"bg-surface-0/50 rounded-lg p-6 border border-surface-hairline/30 overflow-x-auto"},Xt={class:"text-sm text-ink-base font-mono"},Yt={class:"relative bg-surface-0 py-16 sm:py-24 border-t border-surface-hairline/50"},Zt=e("div",{class:"pointer-events-none absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-brand-400/40 to-transparent"},null,-1),Kt={class:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8"},es=e("div",{class:"text-center mb-12"},[e("h2",{class:"font-display text-3xl sm:text-4xl font-semibold tracking-tight text-ink-strong mb-4"}," Perfect for ")],-1),ts={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ss={class:"flex items-start gap-4"},rs={class:"flex items-center justify-center w-11 h-11 rounded-xl bg-brand-500/10 border border-brand-400/30 flex-shrink-0"},ns={class:"w-6 h-6 text-brand-400",viewBox:"0 0 24 24",fill:"currentColor"},as=["d"],os={class:"font-display text-base font-semibold tracking-tight text-ink-strong mb-2"},is={class:"text-sm text-ink-muted"},_s={__name:"RegexTester",setup(ls){const b=_("\\b\\w+@\\w+\\.\\w+\\b"),p=_("g"),l=_("Send invoices to [email protected] or [email protected] \u2014 cc [email protected]."),h=_(""),E=_(!1),R=_(!1),S=_("JavaScript"),D=["JavaScript","Python","PHP"],C=["g","i","m","s","u","y"],H=[{flag:"g",name:"global",title:"Find all matches, not just the first"},{flag:"i",name:"ignoreCase",title:"Case-insensitive matching"},{flag:"m",name:"multiline",title:"^ and $ match line boundaries"},{flag:"s",name:"dotAll",title:". matches newline characters"},{flag:"u",name:"unicode",title:"Full unicode support"},{flag:"y",name:"sticky",title:"Match only from lastIndex"}
1],M=r=>p.value.includes(r),O=r=>{if(M(r))p.value=p.value.split("").filter(s=>s!==r).join("");else{const s=p.value.split("").filter(i=>C.includes(i));s.push(r),p.value=C.filter(i=>s.includes(i)).join("")}},j=y(()=>{if(!b.value)return{regex:null,error:null};const r=p.value.split("").filter(s=>C.includes(s)).join("");try{return{regex:new RegExp(b.value,r),error:null}}catch(s){return{regex:null,error:s.message}}}),k=y(()=>j.value.error),f=y(()=>{const{regex:r}=j.value;if(!r||!l.value)return[];const s=[];if(r.flags.includes("g")){let t;const c=new RegExp(r.source,r.flags);let x=0;for(;(t=c.exec(l.value))!==null&&(s.push({match:t[0],index:t.index,groups:t.slice(1),namedGroups:t.groups||{}}),t.index===c.lastIndex&&c.lastIndex++,!(++x>1e4)););}else{const t=r.exec(l.value);t&&s.push({match:t[0],index:t.index,groups:t.slice(1),namedGroups:t.groups||{}})}return s}),N=r=>r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),G=y(()=>{if(!l.value)return"";if(!f.value.length)return N(l.value);const r=l.value;let s="",i=0;for(const t of f.value)t.index>=i&&(s+=N(r.slice(i,t.index)),s+=`<mark class="bg-brand-500/30 text-ink-strong rounded px-0.5">${N(t.match)}</mark>`,i=t.index+t.match.length);return s+=N(r.slice(i)),s}),B=y(()=>{const{regex:r}=j.value;if(!r||!l.value)return"";try{return l.value.replace(r,h.value)}catch(s){return`Error: ${s.message}`}}),V=[{title:"Character classes",items:[{token:".",desc:"Any character except newline (or any with /s flag)"},{token:"\\d",desc:"Digit (0-9)"},{token:"\\D",desc:"Non-digit"},{token:"\\w",desc:"Word character (A-Z, a-z, 0-9, _)"},{token:"\\W",desc:"Non-word character"},{token:"\\s",desc:"Whitespace (space, tab, newline)"},{token:"\\S",desc:"Non-whitespace"},{token:"[abc]",desc:"Any of a, b, or c"},{token:"[^abc]",desc:"None of a, b, or c"},{token:"[a-z]",desc:"Range a through z"}]},{title:"Anchors & boundaries",items:[{token:"^",desc:"Start of string (or line with /m)"},{token:"$",desc:"End of string (or line with /m)"},{token:"\\b",desc:"Word boundary"},{token:"\\B",desc:"Non-word boundary"}]},{title:"Quantifiers",items:[{token:"*",desc:"0 or more (greedy)"},{token:"+",desc:"1 or more (greedy)"},{token:"?",desc:"0 or 1"},{token:"{n}",desc:"Exactly n"},{token:"{n}",desc:"n or more"},{token:"{n,m}",desc:"Between n and m"},{token:"*?",desc:"Lazy variant (e.g. .*? \u2014 shortest match)"}]},{title:"Groups",items:[{token:"(abc)",desc:"Capture group"},{token:"(?:abc)",desc:"Non-capturing group"},{token:"(?<name>abc)",desc:"Named capture group"},{token:"\\1",desc:"Backreference to group 1"},{token:"(a|b)",desc:"a or b"}]},{title:"Lookaround",items:[{token:"(?=abc)",desc:"Positive lookahead"},{token:"(?!abc)",desc:"Negative lookahead"},{token:"(?<=abc)",desc:"Positive lookbehind"},{token:"(?<!abc)",desc:"Negative lookbehind"}]},{title:"Replacement syntax",items:[{token:"$&",desc:"Whole match"},{token:"$1, $2",desc:"Capture group 1, 2, ..."},{token:"$<name>",desc:"Named capture group"},{token:"$$",desc:"A literal $"},{token:"$`",desc:"Text before the match"},{token:"$'",desc:"Text after the match"}]}],F=[{pattern:"\\b\\w+@\\w+\\.\\w+\\b",flags:"g",text:"Send invoices to [email protected] or [email protected] \u2014 cc [email protected]."},{pattern:"(https?:\\/\\/[^\\s)]+)",flags:"g",text:"Docs are at https://wiki.scrappey.com and the API lives at https://publisher.scrappey.com/api/v1."},{pattern:"(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})",flags:"g",text:"Logs: 2026-05-26 11:42, retry 2026-05-26 11:43, success 2026-05-27 00:01."},{pattern:"\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b",flags:"g",text:"Blocked IPs: 192.168.1.10, 10.0.0.5, 172.16.255.1, and 8.8.8.8 (allowed)."}];let A=0;const U=()=>{const r=F[A%F.length];b.value=r.pattern,p.value=r.flags,l.value=r.text,h.value="",A++},z=y(()=>{const r=b.value||"\\b\\w+@\\w+\\.\\w+\\b",s=p.value.split("").filter(v=>C.includes(v)).join(""),i=[];s.includes("i")&&i.push("re.IGNORECASE"),s.includes("m")&&i.push("re.MULTILINE"),s.includes("s")&&i.push("re.DOTALL"),s.includes("u")&&i.push("re.UNICODE");const t=i.length?", "+i.join(" | "):"",c=s.includes("g")?"findall":"search",x=(s.includes("i")?"i":"")+(s.includes("m")?"m":"")+(s.includes("s")?"s":"")+(s.includes("u")?"u":"");return{JavaScript:`// Test your regex in any JS runtime (browser, Node.js, Deno) 2const re = /${r}/${s}; 3const text = ${JSON.stringify(l.value||"your text here")}; 4 5${s.includes("g")?`// Get every match 6const matches = [...text.matchAll(re)].map(m => m[0]); 7console.log(matches);`:`// Get the first match 8const match = text.match(re); 9console.log(match && match[0]);`} 10 11// Replace 12const replaced = text.replace(re, ${JSON.stringify(h.value||"[REPLACEMENT]")}); 13console.log(replaced);`,Python:`import re 14 15pattern = r"${r.replace(/"/g,'\\"')}" 16text = ${JSON.stringify(l.value||"your text here")} 17 18# Find ${s.includes("g")?"all matches":"first match"} 19${c==="findall"?`matches = re.findall(pattern, text${t}) 20print(matches)`:`m = re.search(pattern, text${t}) 21print(m.group(0) if m else None)`} 22 23# Replace 24replaced = re.sub(pattern, ${JSON.stringify(h.value||"[REPLACEMENT]")}, text${t}) 25print(replaced)`,PHP:`<?php 26$pattern = '/${r.replace(/\//g,"\\/")}/${x}'; 27$text = ${JSON.stringify(l.value||"your text here")}; 28 29// Find ${s.includes("g")?"all matches":"first match"} 30${s.includes("g")?`preg_match_all($pattern, $text, $matches); 31print_r($matches[0]);`:`preg_match($pattern, $text, $match); 32print_r($match[0] ?? null);`} 33 34// Replace 35$replaced = preg_replace($pattern, ${JSON.stringify(h.value||"[REPLACEMENT]")}, $text); 36echo $replaced;`}}),W=[{icon:ce,title:"Real-Time Matching",description:"Every keystroke recompiles the regex and updates matches, highlights, and replacements instantly."},{icon:de,title:"100% Client-Side",description:"Nothing is sent to a server. Test patterns against proprietary data without leaving your browser."},{icon:pe,title:"Full JS Regex Engine",description:"Same engine your co
36de uses in production \u2014 lookbehind, named groups, unicode property escapes, all of it."},{icon:ue,title:"Replacement Preview",description:"See the result of String.prototype.replace with $1, $&, and $<name> substitutions side by side."},{icon:xe,title:"Built-In Cheat Sheet",description:"Quick reference for character classes, anchors, quantifiers, groups, and lookaround \u2014 no tab switching."},{icon:me,title:"Export to Code",description:"Copy ready-to-paste snippets for JavaScript, Python, and PHP using your current pattern and flags."}],q=[{icon:ge,title:"Scraping Extraction Rules",description:"Prototype patterns for extracting emails, prices, IDs, or dates from scraped HTML before wiring them into a scraper."},{icon:he,title:"Input Validation",description:"Write and verify validators for emails, URLs, phone numbers, UUIDs, and structured IDs before shipping."},{icon:be,title:"Log Parsing",description:"Build patterns that pull timestamps, levels, IPs, and request paths out of application or access logs."},{icon:fe,title:"Bulk Find-and-Replace",description:"Refactor strings, normalize content, or transform CSV/JSON snippets with confidence before running it at scale."}],Q=async()=>{try{await navigator.clipboard.writeText(f.value.map(r=>r.match).join(` 37`)),E.value=!0,setTimeout(()=>{E.value=!1},2e3)}catch(r){console.error(r)}},X=async()=>{try{await navigator.clipboard.writeText(B.value),R.value=!0,setTimeout(()=>{R.value=!1},2e3)}catch(r){console.error(r)}},Y=()=>{navigator.clipboard.writeText(z.value[S.value])},{updateMetaTags:Z}=K();return Z({...ee.regexTester}),(r,s)=>{const i=te("router-link");return a(),o(u,null,[m(se),e("section",_e,[e("div",ke,[e("div",ye,[m(ae,{class:"text-sm text-ink-muted"})]),e("div",we,[$e,e("p",Se,[$(" See also: "),m(i,{to:"/tools/xpath-tester",class:"text-brand-400 hover:text-brand-300 underline"},{default:I(()=>[$("XPath Tester")]),_:1}),$(" \xB7 "),m(i,{to:"/tools/css-selector-tester",class:"text-brand-400 hover:text-brand-300 underline"},{default:I(()=>[$("CSS Selector Tester")]),_:1})])])])]),e("div",Ce,[e("section",Ne,[Te,e("div",Le,[e("div",Ee,[Re,e("div",je,[e("div",Pe,[e("img",{src:d(ve),alt:"Regex Tester Visual",class:"w-full h-full object-cover rounded-xl"},null,8,Me)])])])])]),e("section",Be,[Fe,e("div",Ae,[ze,e("div",Ie,[e("div",null,[Je,e("div",De,[He,T(e("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>b.value=t),type:"text",spellcheck:"false",autocomplete:"off",placeholder:"e.g. \\\\b\\\\w+@\\\\w+\\\\.\\\\w+\\\\b",class:"flex-1 bg-surface-0/50 px-3 py-3 text-ink-strong font-mono text-sm focus:outline-none"},null,512),[[L,b.value]]),Oe,T(e("input",{"onUpdate:modelValue":s[1]||(s[1]=t=>p.value=t),type:"text",spellcheck:"false",autocomplete:"off",placeholder:"gimsuy",maxlength:"6",class:"w-24 bg-surface-0/50 px-3 py-3 text-ink-strong font-mono text-sm focus:outline-none border-l border-surface-hairline"},null,512),[[L,p.value]])]),e("div",Ge,[(a(),o(u,null,g(H,t=>e("button",{key:t.flag,onClick:c=>O(t.flag),title:t.title,class:J(["px-3 py-1 rounded-md text-xs font-mono transition-colors",M(t.flag)?"bg-brand-600 text-ink-strong":"bg-surface-hairline text-ink-muted hover:bg-surface-hairline hover:text-ink-strong"])},n(t.flag)+" \u2014 "+n(t.name),11,Ve)),64))]),d(k)?(a(),o("p",Ue," \u26A0 "+n(d(k)),1)):w("",!0)]),e("div",null,[e("div",{class:"flex items-center justify-between mb-2"},[We,e("button",{onClick:U,class:"text-xs text-brand-400 hover:text-brand-300"},"Load sample")]),T(e("textarea",{"onUpdate:modelValue":s[2]||(s[2]=t=>l.value=t),rows:"8",spellcheck:"false",class:"w-full bg-surface-0/50 border border-surface-hairline rounded-lg px-3 py-3 text-ink-strong font-mono text-sm focus:outline-none focus:ring-2 focus:ring-brand-500 resize-y",placeholder:"Paste or type the text to match against..."},null,512),[[L,l.value]])]),!d(k)&&l.value?(a(),o("div",qe,[e("div",Qe,[Xe,e("span",Ye,n(d(f).length)+" match"+n(d(f).length===1?"":"es"),1)]),e("div",Ze,[e("pre",{class:"text-sm font-mono whitespace-pre-wrap break-words text-ink-base",innerHTML:d(G)},null,8,Ke)])])):w("",!0),!d(k)&&d(f).length?(a(),o("div",et,[e("div",tt,[st,e("button",{onClick:Q,class:"px-3 py-1 bg-surface-hairline hover:bg-brand-600 text-ink-strong text-xs rounded transition-colors"}
37,n(E.value?"\u2713 Copied":"Copy all matches"),1)]),e("div",rt,[(a(!0),o(u,null,g(d(f),(t,c)=>(a(),o("div",{key:c,class:"p-3 bg-surface-raised/40 rounded text-sm font-mono"},[e("div",nt,[e("span",at,"#"+n(c+1),1),e("span",ot,"index "+n(t.index)+"\u2013"+n(t.index+t.match.length),1)]),e("div",it,n(t.match),1),t.groups.length?(a(),o("div",lt,[(a(!0),o(u,null,g(t.groups,(x,v)=>(a(),o("div",{key:v,class:"text-xs text-ink-muted"},[e("span",ct,"Group "+n(v+1)+":",1),e("span",dt,n(x===void 0?"<undefined>":x),1)]))),128))])):w("",!0),t.namedGroups&&Object.keys(t.namedGroups).length?(a(),o("div",pt,[(a(!0),o(u,null,g(t.namedGroups,(x,v)=>(a(),o("div",{key:v,class:"text-xs text-ink-muted"},[e("span",ut,n(v)+":",1),e("span",xt,n(x===void 0?"<undefined>":x),1)]))),128))])):w("",!0)]))),128))])])):!d(k)&&l.value&&b.value?(a(),o("div",mt," No matches. ")):w("",!0),e("div",null,[gt,T(e("input",{"onUpdate:modelValue":s[3]||(s[3]=t=>h.value=t),type:"text",spellcheck:"false",autocomplete:"off",placeholder:"e.g. [$1]",class:"w-full bg-surface-0/50 border border-surface-hairline rounded-lg px-3 py-2 text-ink-strong font-mono text-sm focus:outline-none focus:ring-2 focus:ring-brand-500"},null,512),[[L,h.value]]),!d(k)&&l.value&&h.value!==""?(a(),o("div",ht,[e("div",bt,[ft,e("button",{onClick:X,class:"px-3 py-1 bg-surface-hairline hover:bg-brand-600 text-ink-strong text-xs rounded transition-colors"},n(R.value?"\u2713 Copied":"Copy result"),1)]),e("pre",vt,n(d(B)),1)])):w("",!0)])])])]),e("section",_t,[kt,e("div",yt,[wt,e("div",$t,[(a(),o(u,null,g(V,t=>e("div",{key:t.title,class:"rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-6"},[e("h3",St,n(t.title),1),e("dl",Ct,[(a(!0),o(u,null,g(t.items,c=>(a(),o("div",{key:c.token,class:"flex items-start gap-3 text-sm"},[e("dt",Nt,n(c.token),1),e("dd",Tt,n(c.desc),1)]))),128))])])),64))])])]),Lt,e("section",Et,[Rt,e("div",jt,[Pt,e("div",Mt,[(a(),o(u,null,g(W,t=>e("div",{key:t.title,class:"group rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-6 transition-all duration-base ease-out-expo hover:border-brand-400/50"},[e("div",Bt,[(a(),o("svg",Ft,[e("path",{d:t.icon},null,8,At)]))]),e("h3",zt,n(t.title),1),e("p",It,n(t.description),1)])),64))])])]),e("section",Jt,[Dt,e("div",Ht,[Ot,e("div",Gt,[e("div",Vt,[e("div",Ut,[(a(),o(u,null,g(D,t=>e("button",{key:t,onClick:c=>S.value=t,class:J(["px-4 py-2 rounded-lg text-sm font-medium transition-all",S.value===t?"bg-brand-600 text-ink-strong":"bg-surface-hairline text-ink-base hover:bg-surface-hairline"])},n(t),11,Wt)),64))]),e("button",{onClick:Y,class:"px-4 py-2 bg-surface-hairline hover:bg-surface-hairline text-ink-strong text-sm rounded-lg transition-all flex items-center gap-2"},[qt,$(" Copy ")])]),e("div",Qt,[e("pre",Xt,[e("code",null,n(d(z)[S.value]),1)])])])])]),e("section",Yt,[Zt,e("div",Kt,[es,e("div",ts,[(a(),o(u,null,g(q,t=>e("div",{key:t.title,class:"group rounded-2xl border border-surface-hairline bg-surface-raised/50 backdrop-blur-sm p-6 transition-all duration-base ease-out-expo hover:border-brand-400/50"},[e("div",ss,[e("div",rs,[(a(),o("svg",ns,[e("path",{d:t.icon},null,8,as)]))]),e("div",null,[e("h3",os,n(t.title),1),e("p",is,n(t.description),1)])])])),64))])])]),m(le,{compact:!0}),m(oe),m(ie),m(ne,{section:"tool","context-key":"regex-tester"}),m(re)])],64)}}};export{_s as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.