Title: Match A Symbol
Slug: match_a_symbol
Summary: Match A Symbol
Date: 2016-05-01 12:00
Category: Regex
Tags: Basics
Authors: Chris Albon
Based on: Regular Expressions Cookbook
In [1]:
# Load regex package
import re
In [2]:
# Create a variable containing a text string
text = '$100'
In [4]:
# Find all instances of the exact match '$'
re.findall(r'\$', text)
Out[4]: