+ Post New Thread
Results 1 to 5 of 5
How do you do....it? Thread, convert text strings to regex in Technical; Is there a website or program that will let me convert a text string to it's RegEx equivalent? Google isnt ...
  1. #1

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,527
    Thank Post
    1,339
    Thanked 470 Times in 307 Posts
    Blog Entries
    6
    Rep Power
    200

    convert text strings to regex

    Is there a website or program that will let me convert a text string to it's RegEx equivalent?

    Google isnt helping me right now...

  2. #2
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,834
    Thank Post
    918
    Thanked 423 Times in 356 Posts
    Blog Entries
    12
    Rep Power
    88
    Try the chrome or firefox regex plugins

  3. #3

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,511
    Thank Post
    1,457
    Thanked 1,206 Times in 818 Posts
    Rep Power
    723
    Not sure what you mean? A regex string is a text string, it's the format of that string that defines what the regex query finds as a match. Do you mean that you have a string literal which you want to convert to a regex query so that regex returns all matches of that exact string? If the string contains only alphanumeric characters, you don't need to change it. If however it contains special characters (punctuation), then you'll need to escape them, either by placing a backslash before each special character or wrapping the entire string in \Q...\E, i.e. to find "this. is. sparta!" you could wrap it like so: "\Qthis. is. sparta!\E" and regex would treat everything between \Q...\E as literal.

    EDIT: this website was a god send when I started using regex: http://www.regular-expressions.info/tutorial.html
    Last edited by LosOjos; 30th April 2014 at 10:11 AM.

  4. #4

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,527
    Thank Post
    1,339
    Thanked 470 Times in 307 Posts
    Blog Entries
    6
    Rep Power
    200
    I mean I want to convert a string of text (a sentence or so) to a REGEX expression that will get matched, and independent of case.

    I dont really want to have to learn regex, i just want to be able to unput a bunch of words, and it to out put the regex, eg is \ required before a space, or is it a . ?
    @zag, got a link plz? Google shows a mulititude...

  5. #5

    Join Date
    Nov 2010
    Posts
    453
    Thank Post
    59
    Thanked 69 Times in 59 Posts
    Rep Power
    34
    Have a play with Rubular: a Ruby regular expression editor and tester - it's a great tool for helping build regexes.

SHARE:
+ Post New Thread

Similar Threads

  1. [MS Office - 2010] Excel - Convert text to lowercase
    By FunkMaster_J in forum Office Software
    Replies: 7
    Last Post: 2nd June 2011, 10:45 PM
  2. [MS Office - 2010] Convert text column of dates to date values
    By jc1875 in forum Office Software
    Replies: 0
    Last Post: 17th June 2010, 09:51 AM
  3. Converting text to number
    By tw15ns in forum Office Software
    Replies: 4
    Last Post: 26th May 2009, 08:19 PM
  4. Convert Text to an Image
    By danIT in forum Web Development
    Replies: 12
    Last Post: 27th January 2009, 04:21 PM
  5. Software to sen SMS text messages to Parents?
    By tosca925 in forum Educational Software
    Replies: 11
    Last Post: 24th January 2006, 08:42 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •