Skip to tool

Python re.search() Online

Regex match and groups.

The output updates as you type. The tool processes input in your browser.

Worked example

The result begins with the full match followed by captured groups. This browser uses JavaScript regex syntax and flags.

Regex pattern
"/#(\\d+)/"
Flags
""
Sample input
Order #12345
Sample output
1
[
  "#12345",
  "12345"
]

Using this operation in Python

The interactive result uses JavaScript. Python str stores Unicode text. Encode to bytes when an API expects UTF-8 or another byte representation.

Python reference