Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8187791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:40:51+00:00 2026-06-07T02:40:51+00:00

Is there any way to store and read this regexp in YAML by using

  • 0

Is there any way to store and read this regexp in YAML by using python:

regular: /<title [^>]*lang=("|')wo("|')>/ 

Anyone have any idea or some solution for this ?

I have the following error:

    % ch.encode('utf-8'), self.get_mark())
yaml.scanner.ScannerError: while scanning for the next token
found character '|' that cannot start any token
  in "test.yaml", line 10, column 49

My code:

def test2():
    clueAppconf = open('test.yaml')
    clueContext = yaml.load(clueAppconf) 
    print clueContext['webApp']
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:40:53+00:00Added an answer on June 7, 2026 at 2:40 am

    Ok, it looks like the problem is the type of scalar you have chosen to represent this regex. If you’re married to scalars (yaml strings), you’ll need to use double quoted scalars and escape codes for your special characters that it chokes on. So, your yaml should look something like this:

    regular: "/<title [^>]*lang=("\x7C')wo("\x7C')>/" 
    

    I’ve only escaped the character that it was choking on to maintain some semblance of readability, however you may need to escape additional ones depending on whether it throws more errors. Additionally, you could use unicode escape codes. That would look like this:

    regular: "/<title [^>]*lang=("\u007C')wo("\u007C')>/"
    

    I’m a little out on my yaml knowledge, so I don’t know a way to maintain the special characters and their readability in the yaml. Based on my cursory scan of the yaml documentation, this was the best I could find.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any way to store duplicate keys in a dictionary? I have a
Is there any way to store a session variable in OpenEdge SQL similar to
Is there any way to store the generic parameter type passed in at construction
Is there any way to store file creation time in linux? May be filesystem
is there any easy way of store XML data into core data? Currently, my
I'd like to know if there is any way to store a series of
Is there any way to find out or store which app is accessing an
Is there any way to pre compile stored procedures in SQL Server? My requirement
Is there any way to retrieve the names of the stored procedures by some
Is there any alternate way to create stored procedure without putting all query in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.