• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community The Community Real Life Discussion Software & Hardware
« Previous 1 … 87 88 89 90 91 Next »
Advanced text search

Server Time (24h)

Players Online

Active Events - Scoreboard

Latest activity

Advanced text search
Offline Treewyrm
09-14-2007, 02:07 AM,
#6
Alchemist
Posts: 2,084
Threads: 61
Joined: Jul 2007

I think what you mean is called regular expressions. A very powerful string search and replace engine. It's not very friednly though, sometimes you can loose your head trying to understand what that long expression means but still it's very useful, I have been using it for quite some time and it came out handy at times saving a lot of time.

http://en.wikipedia.org/wiki/Regular_expression
http://www.regular-expressions.info/

Many advaned text editors support regular expressions in some way. I can't say if EditPad does, I use TextPad personally, but I'm sure it does.

I can make you replacement expression if you tell me what symbols are allowed in those values (especially if spaces are allowed within the value).

In your case it would probably be this (doesn't work if you have spaces in values, for that it needs to be modified a little bit):

Search expression: "^([[:alnum:]]+)[\ ]*\=[\ ]*([[:alnum:]]+)$"
Replace expression: "$1 = $2" with <strike>PCRE_UNGREEDY flag set on</strike> (figued it's not needed there)

Look for regular expression support in your text editor, usually it is in "search and replace" tool, typically a checkbox enabling usage of expressions in fields.

I use regular expressions a lot when I need to clean up someone's else code (I like when everything looks in the very same style and syntax).

edit:

Ok, here is search expression if you want to have spaces (or just any symbol except for "=" and newline) in values: "^(?U)(.*)[ ]*\=(?-U)[ ]*(.*)$". Replace expression is the same as in previous example.

All it does it looking for lines with pair "value1= value2" no matter now many spaces are between "value" and "=" (there can be none, one, two, three spaces, etc), the result will always turn it into "value1 = value2" pair.

I hope this helps.

Regular expression is a very powerful tool. Coding a dedicated program for this purpose is overkill, IMO.
Reply  


Messages In This Thread
Advanced text search - by Igiss - 09-13-2007, 12:23 PM
Advanced text search - by GlyphStorm - 09-13-2007, 12:29 PM
Advanced text search - by Korrd - 09-13-2007, 02:44 PM
Advanced text search - by RingoW - 09-13-2007, 02:56 PM
Advanced text search - by Igiss - 09-14-2007, 12:52 AM
Advanced text search - by Treewyrm - 09-14-2007, 02:07 AM
Advanced text search - by Korrd - 09-14-2007, 03:48 AM
Advanced text search - by Igiss - 09-14-2007, 03:08 PM
Advanced text search - by sawtyss - 09-14-2007, 07:37 PM
Advanced text search - by Treewyrm - 09-14-2007, 07:57 PM
Advanced text search - by Igiss - 09-15-2007, 12:05 AM
Advanced text search - by Treewyrm - 09-16-2007, 05:45 PM

  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2025 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode