Skip to content

Commit

Permalink
Fix regex string literals to be raw strings which solves Syntax Error…
Browse files Browse the repository at this point in the history
… about the backslash escape character (#1087)
  • Loading branch information
whitphx authored Jul 25, 2024
1 parent d08be15 commit d630dac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/api-examples-source/data.column_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def calculate_age(born):
"email": st.column_config.TextColumn(
"Email",
help="The user's email address",
validate="^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$",
validate=r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$",
),
}

Expand Down
4 changes: 2 additions & 2 deletions python/api-examples-source/data.link_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"apps": st.column_config.LinkColumn(
"Trending apps",
help="The top trending Streamlit apps",
validate="^https://[a-z]+\.streamlit\.app$",
validate=r"^https://[a-z]+\.streamlit\.app$",
max_chars=100,
display_text="https://(.*?)\.streamlit\.app",
display_text=r"https://(.*?)\.streamlit\.app",
),
"creator": st.column_config.LinkColumn(
"App Creator", display_text="Open profile"
Expand Down
2 changes: 1 addition & 1 deletion python/api-examples-source/data.text_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def load_data():
help="Streamlit **widget** commands 🎈",
default="st.",
max_chars=50,
validate="^st\.[a-z_]+$",
validate=r"^st\.[a-z_]+$",
)
},
hide_index=True,
Expand Down

0 comments on commit d630dac

Please sign in to comment.